We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
dl_device
__dlpack__
1 parent c3655ed commit cb80f55Copy full SHA for cb80f55
dpctl/tensor/_usmarray.pyx
@@ -1167,6 +1167,12 @@ cdef class usm_ndarray:
1167
if max_version[0] >= dpctl_dlpack_version[0]:
1168
# DLManagedTensorVersioned path
1169
if dl_device is not None:
1170
+ if not isinstance(dl_device, tuple) or len(dl_device) != 2:
1171
+ raise TypeError(
1172
+ "`__dlpack__` expects `dl_device` to be a "
1173
+ "2-tuple of `(device_type, device_id)`, instead "
1174
+ f"got {type(dl_device)}"
1175
+ )
1176
if dl_device != self.__dlpack_device__():
1177
if copy == False:
1178
raise BufferError(
0 commit comments