Skip to content

Commit 2a90321

Browse files
Fixed issue with sequence of arrays from different device found by @npolina4
1 parent 3036a67 commit 2a90321

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dpctl/tensor/_ctors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ def _copy_through_host_walker(seq_o, usm_res):
363363
if isinstance(seq_o, dpt.usm_ndarray):
364364
usm_res[...] = dpt.asnumpy(seq_o).copy()
365365
return
366+
if hasattr(seq_o, "__sycl_usm_array_interface__"):
367+
usm_ar = _usm_ndarray_from_suai(seq_o)
368+
usm_res[...] = dpt.asnumpy(usm_ar).copy()
369+
return
366370
if isinstance(seq_o, (list, tuple)):
367371
for i, el in enumerate(seq_o):
368372
_copy_through_host_walker(el, usm_res[i])

0 commit comments

Comments
 (0)