@@ -889,7 +889,7 @@ def test_ifftn_orders(self, dtype, enable_nd):
889
889
pass
890
890
891
891
892
- # @testing.with_requires("numpy>=2.0")
892
+ @testing .with_requires ("numpy>=2.0" )
893
893
@pytest .mark .usefixtures ("skip_forward_backward" )
894
894
@testing .parameterize (
895
895
* testing .product (
@@ -925,17 +925,6 @@ def test_rfft(self, xp, dtype):
925
925
def test_irfft (self , xp , dtype ):
926
926
a = testing .shaped_random (self .shape , xp , dtype )
927
927
out = xp .fft .irfft (a , n = self .n , norm = self .norm )
928
-
929
- if dtype == xp .float16 and xp is cupy :
930
- # XXX: np2.0: f16 dtypes differ
931
- out = out .astype (np .float16 )
932
- elif (
933
- xp is np
934
- and np .lib .NumpyVersion (np .__version__ ) < "2.0.0"
935
- and dtype == np .float32
936
- ):
937
- out = out .astype (np .float32 )
938
-
939
928
return out
940
929
941
930
@@ -1008,7 +997,7 @@ def test_rfft_error_on_wrong_plan(self, dtype):
1008
997
assert "Target array size does not match the plan." in str (ex .value )
1009
998
1010
999
1011
- # @testing.with_requires("numpy>=2.0")
1000
+ @testing .with_requires ("numpy>=2.0" )
1012
1001
@pytest .mark .usefixtures ("skip_forward_backward" )
1013
1002
@testing .parameterize (
1014
1003
* (
@@ -1069,13 +1058,6 @@ def test_irfft2(self, xp, dtype, order, enable_nd):
1069
1058
1070
1059
if self .s is None and self .axes in [None , (- 2 , - 1 )]:
1071
1060
pytest .skip ("Input is not Hermitian Symmetric" )
1072
- elif dtype == xp .float16 and xp is cupy :
1073
- pytest .xfail ("XXX: np2.0: f16 dtypes differ" )
1074
- elif (
1075
- np .lib .NumpyVersion (np .__version__ ) < "2.0.0"
1076
- and dtype == np .float32
1077
- ):
1078
- pytest .skip ("dtypes differ" )
1079
1061
1080
1062
a = testing .shaped_random (self .shape , xp , dtype )
1081
1063
if order == "F" :
@@ -1105,7 +1087,7 @@ def test_irfft2(self, dtype):
1105
1087
xp .fft .irfft2 (a , s = self .s , axes = self .axes , norm = self .norm )
1106
1088
1107
1089
1108
- # @testing.with_requires("numpy>=2.0")
1090
+ @testing .with_requires ("numpy>=2.0" )
1109
1091
@pytest .mark .usefixtures ("skip_forward_backward" )
1110
1092
@testing .parameterize (
1111
1093
* (
@@ -1166,13 +1148,6 @@ def test_irfftn(self, xp, dtype, order, enable_nd):
1166
1148
1167
1149
if self .s is None and self .axes in [None , (- 2 , - 1 )]:
1168
1150
pytest .skip ("Input is not Hermitian Symmetric" )
1169
- elif dtype == xp .float16 and xp is cupy :
1170
- pytest .xfail ("XXX: np2.0: f16 dtypes differ" )
1171
- elif (
1172
- np .lib .NumpyVersion (np .__version__ ) < "2.0.0"
1173
- and dtype == np .float32
1174
- ):
1175
- pytest .skip ("dtypes differ" )
1176
1151
1177
1152
a = testing .shaped_random (self .shape , xp , dtype )
1178
1153
if order == "F" :
@@ -1243,10 +1218,6 @@ def test_rfftn(self, xp, dtype, enable_nd):
1243
1218
def test_irfftn (self , xp , dtype , enable_nd ):
1244
1219
assert config .enable_nd_planning == enable_nd
1245
1220
a = testing .shaped_random (self .shape , xp , dtype )
1246
-
1247
- if dtype == xp .float16 and xp is cupy :
1248
- pytest .xfail ("XXX: np2.0: f16 dtypes differ" )
1249
-
1250
1221
if xp is np :
1251
1222
return xp .fft .irfftn (a , s = self .s , axes = self .axes , norm = self .norm )
1252
1223
@@ -1349,7 +1320,7 @@ def test_irfftn(self, dtype):
1349
1320
xp .fft .irfftn (a , s = self .s , axes = self .axes , norm = self .norm )
1350
1321
1351
1322
1352
- # @testing.with_requires("numpy>=2.0")
1323
+ @testing .with_requires ("numpy>=2.0" )
1353
1324
@pytest .mark .usefixtures ("skip_forward_backward" )
1354
1325
@testing .parameterize (
1355
1326
* testing .product (
@@ -1373,17 +1344,6 @@ class TestHfft:
1373
1344
def test_hfft (self , xp , dtype ):
1374
1345
a = testing .shaped_random (self .shape , xp , dtype )
1375
1346
out = xp .fft .hfft (a , n = self .n , norm = self .norm )
1376
-
1377
- if dtype == xp .float16 and xp is cupy :
1378
- # XXX: np2.0: f16 dtypes differ
1379
- out = out .astype (np .float16 )
1380
- elif (
1381
- xp is np
1382
- and np .lib .NumpyVersion (np .__version__ ) < "2.0.0"
1383
- and dtype == np .float32
1384
- ):
1385
- out = out .astype (np .float32 )
1386
-
1387
1347
return out
1388
1348
1389
1349
@testing .for_all_dtypes (no_complex = True )
@@ -1396,16 +1356,7 @@ def test_hfft(self, xp, dtype):
1396
1356
)
1397
1357
def test_ihfft (self , xp , dtype ):
1398
1358
a = testing .shaped_random (self .shape , xp , dtype )
1399
- out = xp .fft .ihfft (a , n = self .n , norm = self .norm )
1400
-
1401
- if (
1402
- xp is np
1403
- and np .lib .NumpyVersion (np .__version__ ) < "2.0.0"
1404
- and dtype == np .float32
1405
- ):
1406
- out = out .astype (np .complex64 )
1407
-
1408
- return out
1359
+ return xp .fft .ihfft (a , n = self .n , norm = self .norm )
1409
1360
1410
1361
1411
1362
# @testing.with_requires("numpy>=2.0")
0 commit comments