@@ -994,27 +994,23 @@ def test_moveaxis_preserve_order(source, destination):
994
994
995
995
996
996
@pytest .mark .parametrize (
997
- "source, destination, expected" ,
997
+ "shape, source, destination, expected" ,
998
998
[
999
- ([0 , 1 ], [2 , 3 ], (2 , 3 , 0 , 1 )),
1000
- ([2 , 3 ], [0 , 1 ], (2 , 3 , 0 , 1 )),
1001
- ([0 , 1 , 2 ], [2 , 3 , 0 ], (2 , 3 , 0 , 1 )),
1002
- ([3 , 0 ], [1 , 0 ], (0 , 3 , 1 , 2 )),
1003
- ([0 , 3 ], [0 , 1 ], (0 , 3 , 1 , 2 )),
999
+ ((0 , 1 , 2 , 3 ), [0 , 1 ], [2 , 3 ], (2 , 3 , 0 , 1 )),
1000
+ ((0 , 1 , 2 , 3 ), [2 , 3 ], [0 , 1 ], (2 , 3 , 0 , 1 )),
1001
+ ((0 , 1 , 2 , 3 ), [0 , 1 , 2 ], [2 , 3 , 0 ], (2 , 3 , 0 , 1 )),
1002
+ ((0 , 1 , 2 , 3 ), [3 , 0 ], [1 , 0 ], (0 , 3 , 1 , 2 )),
1003
+ ((0 , 1 , 2 , 3 ), [0 , 3 ], [0 , 1 ], (0 , 3 , 1 , 2 )),
1004
+ ((1 , 2 , 3 , 4 ), range (4 ), range (4 ), (1 , 2 , 3 , 4 )),
1004
1005
],
1005
1006
)
1006
- def test_moveaxis_move_multiples (source , destination , expected ):
1007
+ def test_moveaxis_move_multiples (shape , source , destination , expected ):
1007
1008
get_queue_or_skip ()
1008
- x = dpt .zeros ((0 , 1 , 2 , 3 ))
1009
- actual = dpt .moveaxis (x , source , destination ).shape
1009
+ x = dpt .zeros (shape )
1010
+ y = dpt .moveaxis (x , source , destination )
1011
+ actual = y .shape
1010
1012
assert_ (actual , expected )
1011
-
1012
-
1013
- def test_moveaxis_gh_1178 ():
1014
- get_queue_or_skip ()
1015
- x = dpt .zeros ((1 , 2 , 3 , 4 ))
1016
- y = dpt .moveaxis (x , range (4 ), range (4 ))
1017
- assert y .shape == x .shape
1013
+ assert y ._pointer == x ._pointer
1018
1014
1019
1015
1020
1016
def test_moveaxis_errors ():
0 commit comments