set_dev_output
- Module.set_dev_output(name, tensor: Tensor)
Sets the output data to the pre-allocated memory on Houmo device with the given tensor name. The output data is output tensors defined with the Tensor objects.
Note
Before calling this function, you must pre-allocate the tensor parameter by creating a Tensor object.
For multi-device models, the tensor must be on COMPND device.
The pre-allocated tensor must match all attributes of the corresponding model output tensor, with the same name specified in the
nameparameter, as retrieved viatcim_lite.runtime.Module.get_output_info(), and must be allocated on the same device type (CPU or Houmo device) and device ID as that output tensor.This function does not automatically copy tensor data to contiguous host CPU memory. You need to call
tcim_lite.runtime.Tensor.to_host()andtcim_lite.runtime.Tensor.cast_to()to explicitly copy and convert tensor data to host CPU memory if needed.