File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -361,8 +361,16 @@ cpdef usm_ndarray from_dlpack_capsule(object py_caps) except +:
361
361
362
362
363
363
cpdef from_dlpack(array):
364
- """ Constructs `usm_ndarray` from a Python object that implements
365
- `__dlpack__` protocol.
364
+ """ dpctl.tensor.from_dlpack(obj)
365
+
366
+ Constructs :class:`dpctl.tensor.usm_ndarray` instance from a Python
367
+ object `obj` that implements `__dlpack__` protocol. The output
368
+ array is always a zero-copy view of the input.
369
+
370
+ Raises:
371
+ TypeError: if `obj` does not implement `__dlpack__` method.
372
+ ValueError: if zero copy view can not be constructed because
373
+ the input array resides on an unsupported device.
366
374
"""
367
375
if not hasattr (array, " __dlpack__" ):
368
376
raise TypeError (
You can’t perform that action at this time.
0 commit comments