@@ -976,10 +976,7 @@ def from_dlpack(x, /, *, device=None, copy=None):
976
976
Device where the output array is to be placed. ``device`` keyword values can be:
977
977
978
978
* ``None``
979
- The data remains on the same device. If the data backing up
980
- input object ``x`` resides on ``"kDLCPU"`` device, the return
981
- type would be :class:`numpy.ndarray`, otherwise the return
982
- type would be :class:`dpctl.tensor.usm_ndarray`.
979
+ The data remains on the same device.
983
980
* oneAPI filter selector string
984
981
SYCL device selected by :ref:`filter selector string <filter_selector_string>`.
985
982
* :class:`dpctl.SyclDevice`
@@ -995,21 +992,10 @@ def from_dlpack(x, /, *, device=None, copy=None):
995
992
method: an integer enumerator representing the device type followed by
996
993
an integer representing the index of the device.
997
994
The only supported :class:`dpctl.tensor.DLDeviceType` device types
998
- are ``"kDLCPU"`` and ``"kDLOneAPI"``. If ``"kDLCPU"`` requested, the
999
- output type is :class:`numpy.ndarray`, otherwise it is
1000
- :class:`dpctl.tensor.usm_ndarray`.
995
+ are ``"kDLCPU"`` and ``"kDLOneAPI"``.
1001
996
1002
997
Default: ``None``.
1003
998
1004
- .. note::
1005
-
1006
- If the return type if :class:`dpctl.tensor.usm_ndarray`, the associated
1007
- SYCL queue is derived from the ``device`` keyword. When ``device``
1008
- keyword value has type :class:`dpctl.SyclQueue`, the explicit queue
1009
- instance is used, when ``device`` keyword value has type :class:`dpctl.tensor.Device`,
1010
- the ``device.sycl_queue`` is used. In all other cases, the cached
1011
- SYCL queue corresponding the implied SYCL device is used.
1012
-
1013
999
copy (bool, optional)
1014
1000
Boolean indicating whether or not to copy the input.
1015
1001
@@ -1029,6 +1015,22 @@ def from_dlpack(x, /, *, device=None, copy=None):
1029
1015
``None`` or ``False``, this may be a view into the original
1030
1016
memory.
1031
1017
1018
+ The type of the returned object
1019
+ depends on where the data backing up input object ``x`` resides.
1020
+ If it resides in a USM allocation on a SYCL device, the
1021
+ type :class:`dpctl.tensor.usm_ndarray` is returned, otherwise if it resides
1022
+ on ``"kDLCPU"`` device the type is :class:`numpy.ndarray`, and otherwise
1023
+ an exception is raised.
1024
+
1025
+ .. note::
1026
+
1027
+ If the return type is :class:`dpctl.tensor.usm_ndarray`, the associated
1028
+ SYCL queue is derived from the ``device`` keyword. When ``device``
1029
+ keyword value has type :class:`dpctl.SyclQueue`, the explicit queue
1030
+ instance is used, when ``device`` keyword value has type :class:`dpctl.tensor.Device`,
1031
+ the ``device.sycl_queue`` is used. In all other cases, the cached
1032
+ SYCL queue corresponding to the implied SYCL device is used.
1033
+
1032
1034
Raises:
1033
1035
TypeError:
1034
1036
if ``x`` does not implement ``__dlpack__`` method
0 commit comments