@@ -17,8 +17,10 @@ def test_amax_amin(func, keepdims, dtype):
1717 [[- 2.0 , 5.0 ], [- 2 , - 1.2 ]],
1818 [[1.0 , - 2.0 ], [5.0 , - 1.1 ]],
1919 ],
20- dtype = dtype ,
2120 )
21+ if numpy .issubdtype (dtype , numpy .unsignedinteger ):
22+ a = numpy .abs (a )
23+ a = a .astype (dtype )
2224 ia = dpnp .array (a )
2325
2426 for axis in range (len (a )):
@@ -28,20 +30,20 @@ def test_amax_amin(func, keepdims, dtype):
2830
2931
3032def _get_min_max_input (type , shape ):
31- size = 1
32- for i in range (len (shape )):
33- size *= shape [i ]
34-
33+ size = numpy .prod (shape )
3534 a = numpy .arange (size , dtype = type )
36- a [int (size / 2 )] = size * size
37- a [int (size / 3 )] = - (size * size )
35+ a [int (size / 2 )] = size + 5
36+ if numpy .issubdtype (type , numpy .unsignedinteger ):
37+ a [int (size / 3 )] = size
38+ else :
39+ a [int (size / 3 )] = - (size + 5 )
3840
3941 return a .reshape (shape )
4042
4143
4244@pytest .mark .parametrize ("dtype" , get_all_dtypes (no_bool = True ))
4345@pytest .mark .parametrize (
44- "shape" , [(4 ,), (2 , 3 ), (4 , 5 , 6 )], ids = ["(4,)" , "(2,3)" , "(4,5, 6)" ]
46+ "shape" , [(4 ,), (2 , 3 ), (4 , 5 , 6 )], ids = ["(4,)" , "(2, 3)" , "(4, 5, 6)" ]
4547)
4648def test_amax_diff_shape (dtype , shape ):
4749 a = _get_min_max_input (dtype , shape )
@@ -59,7 +61,7 @@ def test_amax_diff_shape(dtype, shape):
5961
6062@pytest .mark .parametrize ("dtype" , get_all_dtypes (no_bool = True ))
6163@pytest .mark .parametrize (
62- "shape" , [(4 ,), (2 , 3 ), (4 , 5 , 6 )], ids = ["(4,)" , "(2,3)" , "(4,5, 6)" ]
64+ "shape" , [(4 ,), (2 , 3 ), (4 , 5 , 6 )], ids = ["(4,)" , "(2, 3)" , "(4, 5, 6)" ]
6365)
6466def test_amin_diff_shape (dtype , shape ):
6567 a = _get_min_max_input (dtype , shape )
0 commit comments