Tensor.to_device
- Tensor.to_device(device: str)[source]
Return a copy of this element with the same values stored on a different computational device.
Parameters
- device :
Identifier of the desired storage location. Which ones are supported depends on the array backend (
impl). Always allowed is'cpu', but GPU alternatives like'cuda:0'can offer better performance if available.
Returns
- newelem
Tensor Version of this element with its data array on the desired device.