to_dev

ivy.to_dev(x: Union[ivy.Array, ivy.NativeArray], dev_str: Optional[str] = None, f: Optional[ivy.Framework] = None) → Union[ivy.Array, ivy.NativeArray][source]

Move the input array x to the desired device, specified by device string.

Parameters
  • x (array) – Array to move onto the device.

  • dev_str (str, optional) – device to move the array to ‘cuda:0’, ‘cuda:1’, ‘cpu’ etc. Keep same device if None.

  • f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.

Returns

The array x, but now placed on the target device.


Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty