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
Copy the array from the device on which it currently resides to the specified ``device``.
140
+
141
+
Parameters
142
+
----------
143
+
x: array
144
+
array instance from NumPy or an array API compatible library.
145
+
device: device
146
+
a ``device`` object (see the "Device Support" section of the array API specification).
147
+
stream: Optional[Union[int, Any]]
148
+
stream object to use during copy. In addition to the types supported in ``array.__dlpack__``, implementations may choose to support any library-specific stream object with the caveat that any code using such an object would not be portable.
149
+
150
+
Returns
151
+
-------
152
+
out: array
153
+
an array with the same data and data type as ``x`` and located on the specified ``device``.
154
+
155
+
.. note::
156
+
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.
157
+
"""
158
+
if_is_numpy_array(x):
159
+
ifstreamisnotNone:
160
+
raiseValueError("The stream argument to to_device() is not supported")
0 commit comments