Skip to content

Commit 2fdac4c

Browse files
committed
Adds a test that 0D integral indices are treated as Python scalars when not among consecutive integer arrays
1 parent 87db03a commit 2fdac4c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: dpctl/tests/test_usm_ndarray_indexing.py

+11
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,17 @@ def test_advanced_slice15():
429429
x[ii, 0, ii, :, ii]
430430

431431

432+
def test_advanced_slice16():
433+
q = get_queue_or_skip()
434+
ii = dpt.asarray(1, sycl_queue=q)
435+
i0 = dpt.asarray(False, sycl_queue=q)
436+
i1 = dpt.asarray(True, sycl_queue=q)
437+
x = dpt.reshape(dpt.arange(3**5, dtype="i4", sycl_queue=q), (3,) * 5)
438+
y = x[ii, i0, ii, i1, :]
439+
# TODO: add a shape check here when discrepancy with NumPy is investigated
440+
assert isinstance(y, dpt.usm_ndarray)
441+
442+
432443
def test_boolean_indexing_validation():
433444
get_queue_or_skip()
434445
x = dpt.zeros(10, dtype="i4")

0 commit comments

Comments
 (0)