Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update_argsort_test #1667

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions tests/test_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def test_argsort_dtype(self, dtype):
np_array = numpy.array(a, dtype=dtype)
dp_array = dpnp.array(np_array)

result = dpnp.argsort(dp_array)
expected = numpy.argsort(np_array)
result = dpnp.argsort(dp_array, kind="stable")
expected = numpy.argsort(np_array, kind="stable")
assert_dtype_allclose(result, expected)

@pytest.mark.parametrize("dtype", get_complex_dtypes())
Expand Down
8 changes: 4 additions & 4 deletions tests/third_party/cupy/sorting_tests/test_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ def test_F_order(self, xp):
)
)
class TestArgsort(unittest.TestCase):
def argsort(self, a, axis=-1):
def argsort(self, a, axis=-1, kind=None):
if self.external:
xp = cupy.get_array_module(a)
return xp.argsort(a, axis=axis)
return xp.argsort(a, axis=axis, kind=kind)
else:
return a.argsort(axis=axis)
return a.argsort(axis=axis, kind=kind)

# Test base cases

Expand All @@ -317,7 +317,7 @@ def test_argsort_zero_dim(self, xp, dtype):
@testing.numpy_cupy_array_equal()
def test_argsort_one_dim(self, xp, dtype):
a = testing.shaped_random((10,), xp, dtype)
return self.argsort(a)
return self.argsort(a, axis=-1, kind="stable")

@testing.for_all_dtypes()
@testing.numpy_cupy_array_equal()
Expand Down
Loading