Skip to content

Commit e18f6c1

Browse files
Removed comment, add NotImplementedError to the except clause
1 parent 67e53d3 commit e18f6c1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dpctl/tensor/_dlpack.pyx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ def from_dlpack(x, /, *, device=None, copy=None):
10621062
else:
10631063
raise BufferError(f"Can not import to requested device {dl_device}")
10641064
return _to_usm_ary_from_host_blob(host_blob, dl_device[1])
1065-
except BufferError as e:
1065+
except (BufferError, NotImplementedError) as e:
10661066
# we are here, because dlpack_attr could not deal with requested dl_device,
10671067
# or copying was required
10681068
if copy is False:
@@ -1076,7 +1076,6 @@ def from_dlpack(x, /, *, device=None, copy=None):
10761076
if x_dldev == (device_CPU, 0):
10771077
host_blob = x
10781078
else:
1079-
# this would fail anyway
10801079
dlpack_capsule = dlpack_attr(max_version=(1, 0), dl_device=(device_CPU, 0), copy=copy)
10811080
host_blob = from_dlpack_capsule(dlpack_capsule)
10821081
return _to_usm_ary_from_host_blob(host_blob, dl_device[1])

0 commit comments

Comments
 (0)