paddle.fft. ifftn ( x, s=None, axes=None, norm='backward', name=None ) [source]

Compute the N-D inverse discrete Fourier Transform.

This function computes the inverse of the N-D discrete Fourier Transform over any number of axes in an M-D array by means of the Fast Fourier Transform (FFT). In other words, ifftn(fftn(x)) == x to within numerical accuracy.

The input, analogously to ifft, should be ordered in the same way as is returned by fftn, i.e., it should have the term for zero frequency in all axes in the low-order corner, the positive frequency terms in the first half of all axes, the term for the Nyquist frequency in the middle of all axes and the negative frequency terms in the second half of all axes, in order of decreasingly negative frequency.

  • x (Tensor) – The input data. It’s a Tensor type. It’s a complex.

  • s (sequence of ints, optional) – Shape (length of each transformed axis) of the output (s[0] refers to axis 0, s[1] to axis 1, etc.). This corresponds to n for fft(x, n). Along any axis, if the given shape is smaller than that of the input, the input is cropped. If it is larger, the input is padded with zeros. if s is not given, the shape of the input along the axes specified by axes is used.

  • axes (sequence of ints, optional) – Axes used to calculate FFT. If not given, the last len(s) axes are used, or all axes if s is also not specified.

  • norm (str, optional) – Indicates which direction to scale the forward or backward transform pair and what normalization factor to use. The parameter value must be one of “forward” or “backward” or “ortho”. Default is “backward”, meaning no normalization on the forward transforms and scaling by 1/n on the ifft. “forward” instead applies the 1/n factor on the forward tranform. For norm="ortho", both directions are scaled by 1/sqrt(n).

  • name (str, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name.


complex tensor. The truncated or zero-padded input, transformed along the axes indicated by axes, or by a combination of s and x, as explained in the parameters section above.


>>> import paddle

>>> x = paddle.eye(3)
>>> ifftn_x = paddle.fft.ifftn(x, axes=(1,))
>>> print(ifftn_x)
Tensor(shape=[3, 3], dtype=complex64, place=Place(cpu), stop_gradient=True,