add test for argmin/argmax tie
@@ -58,6 +58,12 @@ class TestSearch(unittest.TestCase):
a = testing.shaped_random((2, 3, 4), xp, dtype)
return a.argmax(axis=2)
+ @testing.for_all_dtypes(no_complex=True)
+ @testing.numpy_cupy_allclose()
+ def test_argmax_tie(self, xp, dtype):
+ a = xp.array([0, 5, 2, 3, 4, 5], dtype)
+ return a.argmax()
+
@testing.for_all_dtypes(no_complex=True)
@testing.numpy_cupy_raises(accept_error=ValueError)
def test_argmax_zero_size(self, xp, dtype):
@@ -124,6 +130,12 @@ class TestSearch(unittest.TestCase):
a = testing.shaped_random((2, 3, 4), xp, dtype)
return a.argmin(axis=2)
+ @testing.for_all_dtypes(no_complex=True)
+ @testing.numpy_cupy_allclose()
+ def test_argmin_tie(self, xp, dtype):
+ a = xp.array([0, 1, 2, 3, 0, 5], dtype)
+ return a.argmin()
+
@testing.for_all_dtypes(no_complex=True)
@testing.numpy_cupy_raises(accept_error=ValueError)
def test_argmin_zero_size(self, xp, dtype):
