Skip to content

Commit 32196f5

Browse files
Removed comment, add NotImplementedError to the except clause
1 parent a470109 commit 32196f5

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
@@ -1067,7 +1067,7 @@ def from_dlpack(x, /, *, device=None, copy=None):
10671067
else:
10681068
raise BufferError(f"Can not import to requested device {dl_device}")
10691069
return _to_usm_ary_from_host_blob(host_blob, dl_device[1])
1070-
except BufferError as e:
1070+
except (BufferError, NotImplementedError) as e:
10711071
# we are here, because dlpack_attr could not deal with requested dl_device,
10721072
# or copying was required
10731073
if copy is False:
@@ -1081,7 +1081,6 @@ def from_dlpack(x, /, *, device=None, copy=None):
10811081
if x_dldev == (device_CPU, 0):
10821082
host_blob = x
10831083
else:
1084-
# this would fail anyway
10851084
dlpack_capsule = dlpack_attr(max_version=(1, 0), dl_device=(device_CPU, 0), copy=copy)
10861085
host_blob = from_dlpack_capsule(dlpack_capsule)
10871086
return _to_usm_ary_from_host_blob(host_blob, dl_device[1])

0 commit comments

Comments
 (0)