Rate this Page

Function torch::fft::fftshift#

Function Documentation#

inline Tensor torch::fft::fftshift(const Tensor &x, at::OptionalIntArrayRef dim = std::nullopt)#

Reorders n-dimensional FFT output to have negative frequency terms first, by a torch.roll operation.

See https://pytorch.org/docs/main/fft.html#torch.fft.fftshift

Example:

auto x = torch::randn({127, 4});
auto centred_fft = torch::fft::fftshift(torch::fft::fftn(x));