Skip to main content

M_getTensorByNameFrom

Function M_getTensorByNameFrom 

Source
pub unsafe extern "C" fn M_getTensorByNameFrom(
    tensorMap: *mut M_AsyncTensorMap,
    name: *const c_char,
    status: *mut M_Status,
) -> *mut M_AsyncTensor
Expand description

Gets a tensor from the tensor map by name.

@param tensorMap The tensor map. @param name The name of the tensor. @param status The status object for reporting errors.

@return A pointer to the tensor. You are responsible for the memory associated with the pointer returned. The memory can be deallocated by calling M_freeTensor(). The held tensor inside the return value is simply borrowed from the corresponding input M_AsyncTensorMap. If the tensor map or name are invalid, a NULL pointer is returned and the status parameter contains an error message.