torch.fft.ifftshift¶
- torch.fft.ifftshift(input, dim=None) → Tensor
fftshift()
的逆。- 参数:
input (Tensor) – FFT 顺序的张量
dim(int,Tuple[int],可选)- 要重新排列的维度。只有在此处指定的维度将被重新排列,其他维度将保持原始顺序。默认:
input
的所有维度。
示例
>>> f = torch.fft.fftfreq(5) >>> f tensor([ 0.0000, 0.2000, 0.4000, -0.4000, -0.2000])
通过
fftshift()
和ifftshift()
的往返操作得到相同的结果:>>> shifted = torch.fft.fftshift(f) >>> torch.fft.ifftshift(shifted) tensor([ 0.0000, 0.2000, 0.4000, -0.4000, -0.2000])