快捷方式

torch.fft.ifftshift

torch.fft.ifftshift(input, dim=None) Tensor

fftshift() 的逆操作。

参数
  • input (Tensor) – FFT 顺序的 tensor

  • dim (int, Tuple[int], optional) – 需要重新排列的维度。只有在此指定的维度会被重新排列,其他维度将保持原始顺序。默认值: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])

文档

访问 PyTorch 全面的开发者文档

查看文档

教程

获取面向初学者和高级开发者的深入教程

查看教程

资源

查找开发资源并获得解答

查看资源