irfft2

paddle.fft. irfft2 ( x, s=None, axes=(- 2, - 1), norm='backward', name=None ) [source]

Computes the inverse of rfft2.

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

  • s (sequence of ints, optional) – Shape of the real output to the inverse FFT. Default is None.

  • axes (sequence of ints, optional) – The axes over which to compute the inverse FFT. Axes must be two-dimensional. If not specified, the last two axes are used by default.

  • norm (str) – 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”.

  • 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 .

Returns

Real tensor. The result of the inverse real 2-D FFT.

Raises
  • ValueError – if s not be a sequence of 2 integers or None.

  • ValueError – if axes not be a sequence of 2 integers or None.

  • ValueError – If the input dimension is smaller than 2.

Examples

import numpy as np
import paddle

x = (np.array([[3,2,3],[2, 2, 3]]) + 1j * np.array([[3,2,3],[2, 2, 3]])).astype(np.complex128)
xp = paddle.to_tensor(x)
irfft2_xp = paddle.fft.irfft2(xp).numpy()
print(irfft2_xp)
#  [[ 2.375 -1.125  0.375  0.875]
#   [ 0.125  0.125  0.125  0.125]]