mindscience.sciops.dft.IRDFTn
- class mindscience.sciops.dft.IRDFTn(shape, dim=None, norm='backward', modes=None, compute_dtype=mstype.float32)[source]
1/2/3D discrete inverse real Fourier transformation on complex number. The results should be same as scipy.fft.irfftn() .
- Parameters
shape (tuple) – The shape of the dimensions to be transformed, other dimensions need not be included.
dim (tuple) – Dimensions to be transformed. Default:
None, the trailing dimensions will be transformed.norm (str) – Normalization mode, should be one of 'forward', 'backward', 'ortho'. Default:
'backward', same as torch.fft.irfftnmodes (Union[tuple, int, None]) – The length of the output transform axis. The modes must be no greater than half of the dimension of input 'x'. Default:
None.compute_dtype (mindspore.dtype) – The type of input tensor. Default:
mstype.float32.
- Inputs:
ar (Tensor) - Real part of the tensor to be transformed, with trailing dimensions aligned with shape, except for the last dimension, which should be shape[-1] / 2 + 1.
ai (Tensor) - Imag part of the tensor to be transformed, with trailing dimensions aligned with shape, except for the last dimension, which should be shape[-1] / 2 + 1.
- Outputs:
br (Tensor) - The output real tensor, with trailing dimensions aligned with shape.
Examples
>>> from mindspore import ops >>> from mindflow.core import IRDFTn >>> full_shape = (2, 32, 512) >>> ar = ops.rand((2, 32, 257)) >>> ai = ops.rand((2, 32, 257)) >>> dft_cell = IRDFTn(full_shape[-2:]) >>> br = dft_cell(ar, ai) >>> print(br.shape) (2, 32, 512)