Skip to content

Commit 3fe2718

Browse files
Added test for gh-1322
1 parent 8ded9c3 commit 3fe2718

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dpctl/tests/test_usm_ndarray_indexing.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,3 +1345,15 @@ def test_nonzero_arg_validation():
13451345
dpt.nonzero(list())
13461346
with pytest.raises(ValueError):
13471347
dpt.nonzero(dpt.asarray(1))
1348+
1349+
1350+
def test_nonzero_dtype():
1351+
"See gh-1322"
1352+
get_queue_or_skip()
1353+
x = dpt.ones((3, 4))
1354+
idx, idy = dpt.nonzero(x)
1355+
# create array using device's
1356+
# default integral data type
1357+
ref = dpt.arange(8)
1358+
assert idx.dtype == ref.dtype
1359+
assert idy.dtype == ref.dtype

0 commit comments

Comments
 (0)