MCPcopy Create free account
hub / github.com/numpy/numpy / to_device

Method to_device

numpy/array_api/_array_object.py:1068–1073  ·  view source on GitHub ↗
(self: Array, device: Device, /, stream: None = None)

Source from the content-addressed store, hash-verified

1066 return self.__class__._new(res)
1067
1068 def to_device(self: Array, device: Device, /, stream: None = None) -> Array:
1069 if stream is not None:
1070 raise ValueError("The stream argument to to_device() is not supported")
1071 if device == 'cpu':
1072 return self
1073 raise ValueError(f"Unsupported device {device!r}")
1074
1075 @property
1076 def dtype(self) -> Dtype:

Callers 1

test_device_propertyFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_device_propertyFunction · 0.64