mindspore.Tensor.move_to
- Tensor.move_to(to, blocking=True)[source]
Copy Tensor to target device synchronously or asynchronously, default synchronously. only support PyNative mode.
- Parameters
- Returns
New Tensor, storged on target device which with the same type and shape as the "self Tensor".
- Raises
ValueError – If the type of blocking is not bool type.
ValueError – If the value of to is not one of
"Ascend"
,"GPU"
,"CPU"
.ValueError – If the run mode is not PyNative mode.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore as ms >>> from mindspore import Tensor >>> x = ms.Tensor([1, 2, 3], ms.int64) >>> new_tensor = x.move_to("CPU")