mindscience.sciops.dft.IDCT
- class mindscience.sciops.dft.IDCT(shape, compute_dtype=mstype.float32)[source]
1D inverse discrete cosine transformation on real number on the last axis. The results should be same as scipy.fft.dct() . Reference: A fast cosine transform in one and two dimensions .
- Parameters
shape (tuple) – The shape of the dimensions to be transformed, other dimensions need not be included. Must be a length-1 tuple.
compute_dtype (mindspore.dtype) – The type of input tensor. Default:
mstype.float32.
- Inputs:
a (Tensor) - The real tensor to be transformed, with trailing dimensions aligned with shape.
- Outputs:
b (Tensor) - The output real tensor, with trailing dimensions aligned with shape.
Examples
>>> from mindspore import ops >>> from mindflow.cell import IDCT >>> a = ops.rand((2, 32, 512)) >>> dft_cell = IDCT(a.shape[-1:]) >>> b = dft_cell(a) >>> print(b.shape) (2, 32, 512)