Shortcuts

Function torch::fft::rfft

Function Documentation

inline Tensor torch::fft::rfft(const Tensor &self, c10::optional<SymInt> n = c10::nullopt, int64_t dim = -1, c10::optional<c10::string_view> norm = c10::nullopt)

Computes the 1 dimensional FFT of real input with onesided Hermitian output.

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

Example:

auto t = torch::randn(128);
auto T = torch::fft::rfft(t);
assert(T.is_complex() && T.numel() == 128 / 2 + 1);

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