You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If ``stream`` is given, the copy operation should be enqueued on the provided ``stream``; otherwise, the copy operation should be enqueued on the default stream/queue. Whether the copy is performed synchronously or asynchronously is implementation-dependent. Accordingly, if synchronization is required to guarantee data safety, this must be clearly explained in a conforming library's documentation.
227
227
"""
228
-
if_is_numpy_array(x):
228
+
ifis_numpy_array(x):
229
229
ifstreamisnotNone:
230
230
raiseValueError("The stream argument to to_device() is not supported")
231
231
ifdevice=='cpu':
232
232
returnx
233
233
raiseValueError(f"Unsupported device {device!r}")
234
-
elif_is_cupy_array(x):
234
+
elifis_cupy_array(x):
235
235
# cupy does not yet have to_device
236
236
return_cupy_to_device(x, device, stream=stream)
237
-
elif_is_torch_array(x):
237
+
elifis_torch_array(x):
238
238
return_torch_to_device(x, device, stream=stream)
239
-
elif_is_dask_array(x):
239
+
elifis_dask_array(x):
240
240
ifstreamisnotNone:
241
241
raiseValueError("The stream argument to to_device() is not supported")
0 commit comments