ToDevice
Function Usage
Transfers the tensor data to the device.
- If the original memory is transferred by the user through the constructor, the memory needs to be managed and destroyed by the user.
- If the memory is allocated by calling TensorMalloc or Malloc, data is transferred to the device, and the original memory is automatically destroyed.
Prototype
1 | APP_ERROR Tensor::ToDevice(int32_t deviceId); |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
deviceId |
Input |
Transfers a tensor to the device specified by deviceId. The deviceId must be a valid device ID. |
Response Parameters
Data Structure |
Description |
|---|---|
APP_ERROR |
For details about the returned error codes, see APP_ERROR Description. |
Parent topic: Tensor