@@ -250,8 +250,8 @@ def test_eigh(x):
250
250
assert eigenvectors .dtype == x .dtype , "eigh().eigenvectors did not return the correct dtype"
251
251
assert eigenvectors .shape == x .shape , "eigh().eigenvectors did not return the correct shape"
252
252
253
- # The order of the eigenvectors is not specified, so make sure the same
254
- # eigenvectors are compared against each other.
253
+ # The order of the eigenvalues is not specified, so make sure the same
254
+ # eigenvalues are compared against each other.
255
255
_test_stacks (lambda x : linalg .eigh (x ).eigenvalues , x ,
256
256
res = eigenvalues , dims = 1 , assert_equal = lambda a , b :
257
257
assert_equal (xp .sort (a ), xp .sort (b )))
@@ -274,7 +274,10 @@ def test_eigvalsh(x):
274
274
assert res .dtype == x .dtype , "eigvalsh() did not return the correct dtype"
275
275
assert res .shape == x .shape [:- 1 ], "eigvalsh() did not return the correct shape"
276
276
277
- _test_stacks (linalg .eigvalsh , x , res = res , dims = 1 )
277
+ # The order of the eigenvalues is not specified, so make sure the same
278
+ # eigenvalues are compared against each other.
279
+ _test_stacks (linalg .eigvalsh , x , res = res , dims = 1 , assert_equal = lambda a ,
280
+ b : assert_equal (xp .sort (a ), xp .sort (b )))
278
281
279
282
# TODO: Should we test that the result is the same as eigh(x).eigenvalues?
280
283
0 commit comments