File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -1293,6 +1293,14 @@ class TestLdexp:
1293
1293
@pytest .mark .parametrize ("mant_dt" , get_float_dtypes ())
1294
1294
@pytest .mark .parametrize ("exp_dt" , get_integer_dtypes ())
1295
1295
def test_basic (self , mant_dt , exp_dt ):
1296
+ if (
1297
+ numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0"
1298
+ and mant_dt == numpy .float32
1299
+ and exp_dt == numpy .int64
1300
+ and numpy .dtype ("l" ) != numpy .int64
1301
+ ):
1302
+ pytest .skip ("numpy.ldexp doesn't have a loop for the input types" )
1303
+
1296
1304
mant = numpy .array (2.0 , dtype = mant_dt )
1297
1305
exp = numpy .array (3 , dtype = exp_dt )
1298
1306
imant , iexp = dpnp .array (mant ), dpnp .array (exp )
Original file line number Diff line number Diff line change @@ -99,8 +99,19 @@ def test_umaths(test_cases):
99
99
args = get_args (args_str , sh , xp = numpy )
100
100
iargs = get_args (args_str , sh , xp = dpnp )
101
101
102
- if umath == "reciprocal" and args [0 ].dtype in [numpy .int32 , numpy .int64 ]:
103
- pytest .skip ("For integer input array, numpy.reciprocal returns zero." )
102
+ if umath == "reciprocal" :
103
+ if args [0 ].dtype in [numpy .int32 , numpy .int64 ]:
104
+ pytest .skip (
105
+ "For integer input array, numpy.reciprocal returns zero."
106
+ )
107
+ elif umath == "ldexp" :
108
+ if (
109
+ numpy .lib .NumpyVersion (numpy .__version__ ) < "2.0.0"
110
+ and args [0 ].dtype == numpy .float32
111
+ and args [1 ].dtype == numpy .int64
112
+ and numpy .dtype ("l" ) != numpy .int64
113
+ ):
114
+ pytest .skip ("numpy.ldexp doesn't have a loop for the input types" )
104
115
105
116
# original
106
117
expected = getattr (numpy , umath )(* args )
You can’t perform that action at this time.
0 commit comments