Skip to content

Commit 8ded9c3

Browse files
Fixes regression in tensor.nonzero introduced in gh-1300
Closes gh-1322 The indexes arrays must be allocated in default integral data type for the target device.
1 parent 79994c1 commit 8ded9c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dpctl/tensor/_copy_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,10 @@ def _nonzero_impl(ary):
517517
mask_nelems, dtype=cumsum_dt, sycl_queue=exec_q, order="C"
518518
)
519519
mask_count = ti.mask_positions(ary, cumsum, sycl_queue=exec_q)
520+
indexes_dt = ti.default_device_int_type(exec_q.sycl_device)
520521
indexes = dpt.empty(
521522
(ary.ndim, mask_count),
522-
dtype=cumsum.dtype,
523+
dtype=indexes_dt,
523524
usm_type=usm_type,
524525
sycl_queue=exec_q,
525526
order="C",

0 commit comments

Comments
 (0)