Method transfer
static member transfer: ITensorDevice -> Tensor<'T> -> Tensor<'T>
Transfers a tensor to the specifed device.
Declaration
static member transfer: dev:ITensorDevice -> src:Tensor<'T> -> Tensor<'T>
Parameters
Type | Name | Description |
---|---|---|
ITensorDevice | dev | The target device. |
Tensor<'T> | src |
Returns
Type | Description |
---|---|
Tensor<'T> | A tensor on the target device. |
Remarks
A new tensor is created on the specified device.
The elements of the original tensor are copied into the new tensor.
If the target device matches the current device of the tensor, the original tensor is returned.
Examples
let a = HostTensor.zeros [3L; 5L] // a.Dev = HostTensor.Dev
let b = Tensor.transfer CudaTensor.Dev a // b.Dev = CudaTensor.Dev