Skip to main content

tract_tensor_from_bytes

Function tract_tensor_from_bytes 

Source
pub unsafe extern "C" fn tract_tensor_from_bytes(
    datum_type: DatumType,
    rank: usize,
    shape: *const usize,
    data: *mut c_void,
    tensor: *mut *mut TractTensor,
) -> TRACT_RESULT
Expand description

Create a TractTensor from caller data and metadata.

This call copies the data into tract space. All the pointers only need to be alive for the duration of the call.

rank is the number of dimensions of the tensor (i.e. the length of the shape vector).

The returned tensor must be destroyed by tract_tensor_destroy.