Skip to content

Commit

Permalink
Adds tests for fixed search reduction behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ndgrigorian committed Nov 1, 2023
1 parent 4b3e736 commit 064a44c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dpctl/tests/test_usm_ndarray_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,22 @@ def test_argmax_argmin_identities():
assert dpt.argmin(x) == 0


@pytest.mark.parametrize("order", ["C", "F"])
def test_argmax_axis0_axis1(order):
get_queue_or_skip()

x = dpt.asarray([[1, 2, 3], [6, 5, 4]], dtype="i4", order=order)
assert dpt.argmax(x) == 3

res = dpt.argmax(x, axis=0)
expected = dpt.asarray([1, 1, 1], dtype=res.dtype)
assert dpt.all(res == expected)

res = dpt.argmax(x, axis=1)
expected = dpt.asarray([2, 0], dtype=res.dtype)
assert dpt.all(res == expected)


def test_reduction_arg_validation():
get_queue_or_skip()

Expand Down

0 comments on commit 064a44c

Please sign in to comment.