99
1010
1111@pytest .mark .parametrize (
12- "x " ,
12+ "x_test " ,
1313 [
1414 [], # Empty list
1515 [3 , 2 , 1 ], # Simple list
2626 ["stable" , UserWarning ],
2727 ],
2828)
29- def test_Sort (x , axis , kind , exc ):
29+ def test_Sort (x_test , axis , kind , exc ):
30+ x = pt .as_tensor (x_test ).type ("x" )
3031 if axis :
31- g = SortOp (kind )(pt . as_tensor_variable ( x ) , axis )
32+ g = SortOp (kind )(x , axis )
3233 else :
33- g = SortOp (kind )(pt . as_tensor_variable ( x ) )
34+ g = SortOp (kind )(x )
3435
3536 cm = contextlib .suppress () if not exc else pytest .warns (exc )
3637
3738 with cm :
38- compare_numba_and_py ([], [g ], [])
39+ compare_numba_and_py ([x ], [g ], [x_test ])
3940
4041
4142@pytest .mark .parametrize (
42- "x " ,
43+ "x_test " ,
4344 [
4445 [], # Empty list
4546 [3 , 2 , 1 ], # Simple list
@@ -55,18 +56,19 @@ def test_Sort(x, axis, kind, exc):
5556 ["stable" , UserWarning ],
5657 ],
5758)
58- def test_ArgSort (x , axis , kind , exc ):
59- if x is None :
60- x = np .arange (5 * 5 * 5 * 5 )
61- np .random .shuffle (x )
62- x = np .reshape (x , (5 , 5 , 5 , 5 ))
59+ def test_ArgSort (x_test , axis , kind , exc ):
60+ if x_test is None :
61+ x_test = np .arange (5 * 5 * 5 * 5 )
62+ np .random .shuffle (x_test )
63+ x_test = np .reshape (x_test , (5 , 5 , 5 , 5 ))
64+ x = pt .as_tensor (x_test ).type ("x" )
6365
6466 if axis :
65- g = ArgSortOp (kind )(pt . as_tensor_variable ( x ) , axis )
67+ g = ArgSortOp (kind )(x , axis )
6668 else :
67- g = ArgSortOp (kind )(pt . as_tensor_variable ( x ) )
69+ g = ArgSortOp (kind )(x )
6870
6971 cm = contextlib .suppress () if not exc else pytest .warns (exc )
7072
7173 with cm :
72- compare_numba_and_py ([], [g ], [])
74+ compare_numba_and_py ([x ], [g ], [x_test ])
0 commit comments