99
1010
1111class TestDims (unittest .TestCase ):
12+
1213 def check_atleast (self , func , xp ):
1314 a = testing .shaped_arange ((), xp )
1415 b = testing .shaped_arange ((2 ,), xp )
1516 c = testing .shaped_arange ((2 , 2 ), xp )
1617 d = testing .shaped_arange ((4 , 3 , 2 ), xp )
17- e = 1
18- f = numpy .float32 (1 )
19- return func (a , b , c , d , e , f )
18+ # scalar input is not supported
19+ # e = 1
20+ # f = numpy.float32(1)
21+ # return func(a, b, c, d, e, f)
22+ return func (a , b , c , d )
2023
21- @pytest .mark .skip (reason = "Scalar input is not supported" )
2224 @testing .numpy_cupy_array_equal ()
2325 def test_atleast_1d1 (self , xp ):
2426 return self .check_atleast (xp .atleast_1d , xp )
@@ -28,7 +30,6 @@ def test_atleast_1d2(self, xp):
2830 a = testing .shaped_arange ((1 , 3 , 2 ), xp )
2931 return xp .atleast_1d (a )
3032
31- @pytest .mark .skip (reason = "Scalar input is not supported" )
3233 @testing .numpy_cupy_array_equal ()
3334 def test_atleast_2d1 (self , xp ):
3435 return self .check_atleast (xp .atleast_2d , xp )
@@ -38,7 +39,6 @@ def test_atleast_2d2(self, xp):
3839 a = testing .shaped_arange ((1 , 3 , 2 ), xp )
3940 return xp .atleast_2d (a )
4041
41- @pytest .mark .skip (reason = "Scalar input is not supported" )
4242 @testing .numpy_cupy_array_equal ()
4343 def test_atleast_3d1 (self , xp ):
4444 return self .check_atleast (xp .atleast_3d , xp )
@@ -295,6 +295,7 @@ def test_external_squeeze(self, xp):
295295 {"shapes" : [(0 , 1 , 1 , 0 , 3 ), (5 , 2 , 0 , 1 , 0 , 0 , 3 ), (2 , 1 , 0 , 0 , 0 , 3 )]},
296296)
297297class TestBroadcast (unittest .TestCase ):
298+
298299 def _broadcast (self , xp , dtype , shapes ):
299300 arrays = [testing .shaped_arange (s , xp , dtype ) for s in shapes ]
300301 return xp .broadcast (* arrays )
@@ -337,6 +338,7 @@ def test_broadcast_arrays(self, xp, dtype):
337338 {"shapes" : [(0 ,), (2 ,)]},
338339)
339340class TestInvalidBroadcast (unittest .TestCase ):
341+
340342 @testing .for_all_dtypes ()
341343 def test_invalid_broadcast (self , dtype ):
342344 for xp in (numpy , cupy ):
0 commit comments