36
36
37
37
import mkl_fft
38
38
39
- from .._fft_utils import _compute_fwd_scale , _swap_direction
39
+ from .._fft_utils import _swap_direction
40
40
from ._float_utils import _downcast_float128_array
41
41
42
42
__all__ = [
@@ -120,10 +120,8 @@ def fft(a, n=None, axis=-1, norm=None, out=None):
120
120
121
121
"""
122
122
x = _downcast_float128_array (a )
123
- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
124
-
125
123
return _trycall (
126
- mkl_fft .fft , (x ,), {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out }
124
+ mkl_fft .fft , (x ,), {"n" : n , "axis" : axis , "norm " : norm , "out" : out }
127
125
)
128
126
129
127
@@ -135,10 +133,8 @@ def ifft(a, n=None, axis=-1, norm=None, out=None):
135
133
136
134
"""
137
135
x = _downcast_float128_array (a )
138
- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
139
-
140
136
return _trycall (
141
- mkl_fft .ifft , (x ,), {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out }
137
+ mkl_fft .ifft , (x ,), {"n" : n , "axis" : axis , "norm " : norm , "out" : out }
142
138
)
143
139
144
140
@@ -171,10 +167,9 @@ def fftn(a, s=None, axes=None, norm=None, out=None):
171
167
"""
172
168
x = _downcast_float128_array (a )
173
169
s , axes = _cook_nd_args (x , s , axes )
174
- fsc = _compute_fwd_scale (norm , s , x .shape )
175
170
176
171
return _trycall (
177
- mkl_fft .fftn , (x ,), {"s" : s , "axes" : axes , "fwd_scale " : fsc , "out" : out }
172
+ mkl_fft .fftn , (x ,), {"s" : s , "axes" : axes , "norm " : norm , "out" : out }
178
173
)
179
174
180
175
@@ -187,12 +182,11 @@ def ifftn(a, s=None, axes=None, norm=None, out=None):
187
182
"""
188
183
x = _downcast_float128_array (a )
189
184
s , axes = _cook_nd_args (x , s , axes )
190
- fsc = _compute_fwd_scale (norm , s , x .shape )
191
185
192
186
return _trycall (
193
187
mkl_fft .ifftn ,
194
188
(x ,),
195
- {"s" : s , "axes" : axes , "fwd_scale " : fsc , "out" : out },
189
+ {"s" : s , "axes" : axes , "norm " : norm , "out" : out },
196
190
)
197
191
198
192
@@ -204,10 +198,9 @@ def rfft(a, n=None, axis=-1, norm=None, out=None):
204
198
205
199
"""
206
200
x = _downcast_float128_array (a )
207
- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
208
201
209
202
return _trycall (
210
- mkl_fft .rfft , (x ,), {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out }
203
+ mkl_fft .rfft , (x ,), {"n" : n , "axis" : axis , "norm " : norm , "out" : out }
211
204
)
212
205
213
206
@@ -219,12 +212,11 @@ def irfft(a, n=None, axis=-1, norm=None, out=None):
219
212
220
213
"""
221
214
x = _downcast_float128_array (a )
222
- fsc = _compute_fwd_scale (norm , n , 2 * (x .shape [axis ] - 1 ))
223
215
224
216
return _trycall (
225
217
mkl_fft .irfft ,
226
218
(x ,),
227
- {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out },
219
+ {"n" : n , "axis" : axis , "norm " : norm , "out" : out },
228
220
)
229
221
230
222
@@ -257,12 +249,11 @@ def rfftn(a, s=None, axes=None, norm=None, out=None):
257
249
"""
258
250
x = _downcast_float128_array (a )
259
251
s , axes = _cook_nd_args (x , s , axes )
260
- fsc = _compute_fwd_scale (norm , s , x .shape )
261
252
262
253
return _trycall (
263
254
mkl_fft .rfftn ,
264
255
(x ,),
265
- {"s" : s , "axes" : axes , "fwd_scale " : fsc , "out" : out },
256
+ {"s" : s , "axes" : axes , "norm " : norm , "out" : out },
266
257
)
267
258
268
259
@@ -276,12 +267,11 @@ def irfftn(a, s=None, axes=None, norm=None, out=None):
276
267
277
268
x = _downcast_float128_array (a )
278
269
s , axes = _cook_nd_args (x , s , axes , invreal = True )
279
- fsc = _compute_fwd_scale (norm , s , x .shape )
280
270
281
271
return _trycall (
282
272
mkl_fft .irfftn ,
283
273
(x ,),
284
- {"s" : s , "axes" : axes , "fwd_scale " : fsc , "out" : out },
274
+ {"s" : s , "axes" : axes , "norm " : norm , "out" : out },
285
275
)
286
276
287
277
@@ -295,12 +285,10 @@ def hfft(a, n=None, axis=-1, norm=None, out=None):
295
285
"""
296
286
norm = _swap_direction (norm )
297
287
x = _downcast_float128_array (a )
298
- fsc = _compute_fwd_scale (norm , n , 2 * (x .shape [axis ] - 1 ))
299
-
300
288
return _trycall (
301
289
mkl_fft .irfft ,
302
290
(np .conjugate (x ),),
303
- {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out },
291
+ {"n" : n , "axis" : axis , "norm " : norm , "out" : out },
304
292
)
305
293
306
294
@@ -313,10 +301,9 @@ def ihfft(a, n=None, axis=-1, norm=None, out=None):
313
301
"""
314
302
norm = _swap_direction (norm )
315
303
x = _downcast_float128_array (a )
316
- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
317
304
318
305
result = _trycall (
319
- mkl_fft .rfft , (x ,), {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out }
306
+ mkl_fft .rfft , (x ,), {"n" : n , "axis" : axis , "norm " : norm , "out" : out }
320
307
)
321
308
322
309
np .conjugate (result , out = result )
0 commit comments