Function Method_set_output_data_ptr

Source
pub unsafe extern "C" fn Method_set_output_data_ptr(
    this: *mut Method,
    buffer: *mut c_void,
    size: usize,
    output_idx: usize,
) -> Error
Expand description

Sets the data buffer of the specified method output to the provided value.

NOTE: Based on the memory plan of the method, the output tensors may not have buffer space pre-allocated for them, in this case the executor will point those tensors to the buffer provided here, so the user should take care that the life span of this memory outlasts the executor forward.

@param[in] buffer The block of memory to point the specified tensor at.

@param[in] size the length of buffer in bytes, must be >= the nbytes of the specified tensor.

@param[in] output_idx The index of the output to set the data_ptr for. Must correspond to a tensor, and that tensor must not have had a buffer allocated by the memory plan.

@returns Error::Ok on success, non-Ok on failure.