3636
3737import mkl_fft
3838
39- from .._fft_utils import _compute_fwd_scale , _swap_direction
39+ from .._fft_utils import _swap_direction
4040from ._float_utils import _downcast_float128_array
4141
4242__all__ = [
@@ -120,10 +120,8 @@ def fft(a, n=None, axis=-1, norm=None, out=None):
120120
121121 """
122122 x = _downcast_float128_array (a )
123- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
124-
125123 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 }
127125 )
128126
129127
@@ -135,10 +133,8 @@ def ifft(a, n=None, axis=-1, norm=None, out=None):
135133
136134 """
137135 x = _downcast_float128_array (a )
138- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
139-
140136 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 }
142138 )
143139
144140
@@ -171,10 +167,9 @@ def fftn(a, s=None, axes=None, norm=None, out=None):
171167 """
172168 x = _downcast_float128_array (a )
173169 s , axes = _cook_nd_args (x , s , axes )
174- fsc = _compute_fwd_scale (norm , s , x .shape )
175170
176171 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 }
178173 )
179174
180175
@@ -187,12 +182,11 @@ def ifftn(a, s=None, axes=None, norm=None, out=None):
187182 """
188183 x = _downcast_float128_array (a )
189184 s , axes = _cook_nd_args (x , s , axes )
190- fsc = _compute_fwd_scale (norm , s , x .shape )
191185
192186 return _trycall (
193187 mkl_fft .ifftn ,
194188 (x ,),
195- {"s" : s , "axes" : axes , "fwd_scale " : fsc , "out" : out },
189+ {"s" : s , "axes" : axes , "norm " : norm , "out" : out },
196190 )
197191
198192
@@ -204,10 +198,9 @@ def rfft(a, n=None, axis=-1, norm=None, out=None):
204198
205199 """
206200 x = _downcast_float128_array (a )
207- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
208201
209202 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 }
211204 )
212205
213206
@@ -219,12 +212,11 @@ def irfft(a, n=None, axis=-1, norm=None, out=None):
219212
220213 """
221214 x = _downcast_float128_array (a )
222- fsc = _compute_fwd_scale (norm , n , 2 * (x .shape [axis ] - 1 ))
223215
224216 return _trycall (
225217 mkl_fft .irfft ,
226218 (x ,),
227- {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out },
219+ {"n" : n , "axis" : axis , "norm " : norm , "out" : out },
228220 )
229221
230222
@@ -257,12 +249,11 @@ def rfftn(a, s=None, axes=None, norm=None, out=None):
257249 """
258250 x = _downcast_float128_array (a )
259251 s , axes = _cook_nd_args (x , s , axes )
260- fsc = _compute_fwd_scale (norm , s , x .shape )
261252
262253 return _trycall (
263254 mkl_fft .rfftn ,
264255 (x ,),
265- {"s" : s , "axes" : axes , "fwd_scale " : fsc , "out" : out },
256+ {"s" : s , "axes" : axes , "norm " : norm , "out" : out },
266257 )
267258
268259
@@ -276,12 +267,11 @@ def irfftn(a, s=None, axes=None, norm=None, out=None):
276267
277268 x = _downcast_float128_array (a )
278269 s , axes = _cook_nd_args (x , s , axes , invreal = True )
279- fsc = _compute_fwd_scale (norm , s , x .shape )
280270
281271 return _trycall (
282272 mkl_fft .irfftn ,
283273 (x ,),
284- {"s" : s , "axes" : axes , "fwd_scale " : fsc , "out" : out },
274+ {"s" : s , "axes" : axes , "norm " : norm , "out" : out },
285275 )
286276
287277
@@ -295,12 +285,10 @@ def hfft(a, n=None, axis=-1, norm=None, out=None):
295285 """
296286 norm = _swap_direction (norm )
297287 x = _downcast_float128_array (a )
298- fsc = _compute_fwd_scale (norm , n , 2 * (x .shape [axis ] - 1 ))
299-
300288 return _trycall (
301289 mkl_fft .irfft ,
302290 (np .conjugate (x ),),
303- {"n" : n , "axis" : axis , "fwd_scale " : fsc , "out" : out },
291+ {"n" : n , "axis" : axis , "norm " : norm , "out" : out },
304292 )
305293
306294
@@ -313,10 +301,9 @@ def ihfft(a, n=None, axis=-1, norm=None, out=None):
313301 """
314302 norm = _swap_direction (norm )
315303 x = _downcast_float128_array (a )
316- fsc = _compute_fwd_scale (norm , n , x .shape [axis ])
317304
318305 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 }
320307 )
321308
322309 np .conjugate (result , out = result )
0 commit comments