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.
2 parents fb31b6a + 7cf0b79 commit 35d333aCopy full SHA for 35d333a
tests/test_torch.py
@@ -130,3 +130,13 @@ def test_meshgrid():
130
assert Y.shape == Y_ij.shape
131
assert xp.all(Y == Y_ij)
132
133
+
134
+def test_argsort_stable():
135
+ """Verify that argsort defaults to a stable sort."""
136
+ # Bare pytorch defaults to an unstable sort, and the array_api_compat wrapper
137
+ # enforces the stable=True default.
138
+ # cf https://github.com/data-apis/array-api-compat/pull/356 and
139
+ # https://github.com/data-apis/array-api-tests/pull/390#issuecomment-3452868329
140
141
+ t = xp.zeros(50) # should be >16
142
+ assert xp.all(xp.argsort(t) == xp.arange(50))
0 commit comments