Shortcuts

torch.fft.ifftshift

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

Inverse of fftshift().

Parameters:
  • input (Tensor) – the tensor in FFT order

  • dim (int, Tuple[int], optional) – The dimensions to rearrange. Only dimensions specified here will be rearranged, any other dimensions will be left in their original order. Default: All dimensions of input.

Example

>>> f = torch.fft.fftfreq(5)
>>> f
tensor([ 0.0000,  0.2000,  0.4000, -0.4000, -0.2000])

A round-trip through fftshift() and ifftshift() gives the same result:

>>> shifted = torch.fft.fftshift(f)
>>> torch.fft.ifftshift(shifted)
tensor([ 0.0000,  0.2000,  0.4000, -0.4000, -0.2000])

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources