Show / Hide Table of Contents

    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
    See Also
    member TransferFrom: Tensor<'T> -> unit
    member Dev: unit -> ITensorDevice
    static member copy: Tensor<'T> * TensorOrder option -> Tensor<'T>
    Back to top Generated by DocFX