Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adds a test that 0D integral indices are treated as Python scalars wh…
…en not among consecutive integer arrays
  • Loading branch information
ndgrigorian committed Apr 9, 2025
commit 2fdac4cb555aa3c82f9a6d036076d3128bc7d9d0
11 changes: 11 additions & 0 deletions dpctl/tests/test_usm_ndarray_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,17 @@ def test_advanced_slice15():
x[ii, 0, ii, :, ii]


def test_advanced_slice16():
q = get_queue_or_skip()
ii = dpt.asarray(1, sycl_queue=q)
i0 = dpt.asarray(False, sycl_queue=q)
i1 = dpt.asarray(True, sycl_queue=q)
x = dpt.reshape(dpt.arange(3**5, dtype="i4", sycl_queue=q), (3,) * 5)
y = x[ii, i0, ii, i1, :]
# TODO: add a shape check here when discrepancy with NumPy is investigated
assert isinstance(y, dpt.usm_ndarray)


def test_boolean_indexing_validation():
get_queue_or_skip()
x = dpt.zeros(10, dtype="i4")
Expand Down