捷徑

torch.fft.ifftshift

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

fftshift() 的反函數。

參數
  • input (Tensor) – FFT 順序的張量

  • 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 的全面開發者文件

檢視文件

教學課程

獲取針對初學者和進階開發者的深入教學課程

檢視教學課程

資源

尋找開發資源並取得問題解答

檢視資源