fn
irfft2
→Tensorirfft2(input: Tensor, s: Sequence[int] | None = None, dim: Sequence[int] = (-2, -1), norm: str | None = None)2-D inverse FFT for a Hermitian-symmetric spectrum.
Recovers a real 2-D signal from its one-sided 2-D spectrum as
produced by rfft2. The output is guaranteed to be
real-valued.
For an input of shape where , the default full output size is (assuming an even last-axis length ).
Parameters
inputTensorComplex Hermitian tensor (one-sided 2-D spectrum) with at least
2 dimensions, typically the output of
rfft2.ssequence of int= NoneFull output sizes
(M_out, N_out) along the two transformed
axes. Pass the original signal shape to avoid the even/odd
ambiguity in the last axis. If None, the last axis
defaults to .dimsequence of int= (-2, -1)The two axes over which to compute the inverse transform.
Default is
(-2, -1).normstr or None= NoneNormalisation mode —
"backward" (default), "forward", or
"ortho". See fftn for the full description.Returns
TensorReal tensor (float32) with the same shape as input
except the two transformed axes have lengths s[0] and
s[1] (or inferred sizes when s is None).
Notes
Odd-length last axis — if the original image had an odd number
of columns , always pass s=[M, N] explicitly.
Examples
Round-trip for a 128×256 image:
>>> x = lucid.randn(128, 256)
>>> X = lucid.fft.rfft2(x)
>>> X.shape # (128, 129)
(128, 129)
>>> x_rec = lucid.fft.irfft2(X, s=[128, 256])
>>> x_rec.shape
(128, 256)