@@ -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
* (
@@ -1066,17 +1055,6 @@ def test_rfft2(self, xp, dtype, order, enable_nd):
1066
1055
)
1067
1056
def test_irfft2 (self , xp , dtype , order , enable_nd ):
1068
1057
# assert config.enable_nd_planning == enable_nd
1069
-
1070
- if self .s is None and self .axes in [None , (- 2 , - 1 )]:
1071
- 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
-
1080
1058
a = testing .shaped_random (self .shape , xp , dtype )
1081
1059
if order == "F" :
1082
1060
a = xp .asfortranarray (a )
@@ -1105,7 +1083,7 @@ def test_irfft2(self, dtype):
1105
1083
xp .fft .irfft2 (a , s = self .s , axes = self .axes , norm = self .norm )
1106
1084
1107
1085
1108
- # @testing.with_requires("numpy>=2.0")
1086
+ @testing .with_requires ("numpy>=2.0" )
1109
1087
@pytest .mark .usefixtures ("skip_forward_backward" )
1110
1088
@testing .parameterize (
1111
1089
* (
@@ -1163,17 +1141,6 @@ def test_rfftn(self, xp, dtype, order, enable_nd):
1163
1141
)
1164
1142
def test_irfftn (self , xp , dtype , order , enable_nd ):
1165
1143
# assert config.enable_nd_planning == enable_nd
1166
-
1167
- if self .s is None and self .axes in [None , (- 2 , - 1 )]:
1168
- 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
-
1177
1144
a = testing .shaped_random (self .shape , xp , dtype )
1178
1145
if order == "F" :
1179
1146
a = xp .asfortranarray (a )
@@ -1243,10 +1210,6 @@ def test_rfftn(self, xp, dtype, enable_nd):
1243
1210
def test_irfftn (self , xp , dtype , enable_nd ):
1244
1211
assert config .enable_nd_planning == enable_nd
1245
1212
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
1213
if xp is np :
1251
1214
return xp .fft .irfftn (a , s = self .s , axes = self .axes , norm = self .norm )
1252
1215
@@ -1373,17 +1336,6 @@ class TestHfft:
1373
1336
def test_hfft (self , xp , dtype ):
1374
1337
a = testing .shaped_random (self .shape , xp , dtype )
1375
1338
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
1339
return out
1388
1340
1389
1341
@testing .for_all_dtypes (no_complex = True )
@@ -1396,16 +1348,7 @@ def test_hfft(self, xp, dtype):
1396
1348
)
1397
1349
def test_ihfft (self , xp , dtype ):
1398
1350
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
1351
+ return xp .fft .ihfft (a , n = self .n , norm = self .norm )
1409
1352
1410
1353
1411
1354
# @testing.with_requires("numpy>=2.0")
0 commit comments