Skip to content

Commit 00b333f

Browse files
Expanded doc-string of dpctl.tensor.usm_ndarray.to_device
1 parent ea4e009 commit 00b333f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

dpctl/tensor/_usmarray.pyx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,21 @@ cdef class usm_ndarray:
640640

641641
def to_device(self, target_device):
642642
"""
643-
Transfer array to target device
643+
Transfers this array to specified target device.
644+
645+
Args:
646+
target_device: array API concept of target device.
647+
target_device can be a oneAPI filter selector string,
648+
an instance of :class:`dpctl.SyclDevice` corresponding to a
649+
non-partitioned SYCL device, an instance of
650+
:class:`dpctl.SyclQueue`, or a :class:`dpctl.tensor.Device`
651+
object returned by :property:`dpctl.tensor.usm_array.device`.
652+
653+
Returns:
654+
A view if data copy is not required, and a copy otherwise.
655+
If copying is required, it is done by copying from original
656+
allocation device to the host, followed by copying from host
657+
to the target device.
644658
"""
645659
cdef c_dpctl.DPCTLSyclQueueRef QRef = NULL
646660
cdef c_dpmem._Memory arr_buf

0 commit comments

Comments
 (0)