to_device

Applicable Products

All processors

Function Usage

Moves the current tensor from the host to the device.

Prototype

1
to_device()->Tensor

Parameters

None

Returns

(Tensor) Returns itself to support chain calls.

Restrictions

  • If the current tensor is not the host memory, ValueError is thrown.
  • If the movement fails, RuntimeError is thrown.