We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8b9dc4 commit 30ec9bbCopy full SHA for 30ec9bb
tests/test_torch.py
@@ -117,3 +117,14 @@ def test_meshgrid():
117
118
assert Y.shape == Y_xy.shape
119
assert xp.all(Y == Y_xy)
120
+
121
122
+def test_argsort_stable():
123
+ """Verify that argsort defaults to a stable sort."""
124
+ # Bare pytorch defaults to an unstable sort, and the array_api_compat wrapper
125
+ # enforces the stable=True default.
126
+ # cf https://github.com/data-apis/array-api-compat/pull/356 and
127
+ # https://github.com/data-apis/array-api-tests/pull/390#issuecomment-3452868329
128
129
+ t = xp.zeros(50) # should be >16
130
+ assert xp.all(xp.argsort(t) == xp.arange(50))
0 commit comments