Rate this Page

Program Listing for File fft.h#

Return to documentation for file (torch/csrc/api/include/torch/fft.h)

#pragma once

#include <ATen/ATen.h>
#include <torch/types.h>

#include <utility>

namespace torch::fft {

inline Tensor fft(
    const Tensor& self,
    std::optional<SymInt> n = std::nullopt,
    int64_t dim = -1,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_fft_symint(self, std::move(n), dim, norm);
}

inline Tensor ifft(
    const Tensor& self,
    std::optional<SymInt> n = std::nullopt,
    int64_t dim = -1,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_ifft_symint(self, std::move(n), dim, norm);
}

inline Tensor fft2(
    const Tensor& self,
    OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_fft2(self, s, dim, norm);
}

inline Tensor ifft2(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_ifft2(self, s, dim, norm);
}

inline Tensor fftn(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    at::OptionalIntArrayRef dim = std::nullopt,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_fftn(self, s, dim, norm);
}

inline Tensor ifftn(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    at::OptionalIntArrayRef dim = std::nullopt,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_ifftn(self, s, dim, norm);
}

inline Tensor rfft(
    const Tensor& self,
    std::optional<SymInt> n = std::nullopt,
    int64_t dim = -1,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_rfft_symint(self, std::move(n), dim, norm);
}

inline Tensor irfft(
    const Tensor& self,
    std::optional<SymInt> n = std::nullopt,
    int64_t dim = -1,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_irfft_symint(self, std::move(n), dim, norm);
}

inline Tensor rfft2(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_rfft2(self, s, dim, norm);
}

inline Tensor irfft2(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_irfft2(self, s, dim, norm);
}

inline Tensor rfftn(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    at::OptionalIntArrayRef dim = std::nullopt,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_rfftn(self, s, dim, norm);
}

inline Tensor irfftn(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    at::OptionalIntArrayRef dim = std::nullopt,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_irfftn(self, s, dim, norm);
}

inline Tensor hfft(
    const Tensor& self,
    std::optional<SymInt> n = std::nullopt,
    int64_t dim = -1,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_hfft_symint(self, std::move(n), dim, norm);
}

inline Tensor ihfft(
    const Tensor& self,
    std::optional<SymInt> n = std::nullopt,
    int64_t dim = -1,
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_ihfft_symint(self, std::move(n), dim, norm);
}

inline Tensor hfft2(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_hfft2(self, s, dim, norm);
}

inline Tensor ihfft2(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_ihfft2(self, s, dim, norm);
}

inline Tensor hfftn(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_hfftn(self, s, dim, norm);
}

inline Tensor ihfftn(
    const Tensor& self,
    at::OptionalIntArrayRef s = std::nullopt,
    IntArrayRef dim = {-2, -1},
    std::optional<std::string_view> norm = std::nullopt) {
  return torch::fft_ihfftn(self, s, dim, norm);
}

inline Tensor fftfreq(int64_t n, double d, const TensorOptions& options = {}) {
  return torch::fft_fftfreq(n, d, options);
}

inline Tensor fftfreq(int64_t n, const TensorOptions& options = {}) {
  return torch::fft_fftfreq(n, /*d=*/1.0, options);
}

inline Tensor rfftfreq(int64_t n, double d, const TensorOptions& options) {
  return torch::fft_rfftfreq(n, d, options);
}

inline Tensor rfftfreq(int64_t n, const TensorOptions& options) {
  return torch::fft_rfftfreq(n, /*d=*/1.0, options);
}

inline Tensor fftshift(
    const Tensor& x,
    at::OptionalIntArrayRef dim = std::nullopt) {
  return torch::fft_fftshift(x, dim);
}

inline Tensor ifftshift(
    const Tensor& x,
    at::OptionalIntArrayRef dim = std::nullopt) {
  return torch::fft_ifftshift(x, dim);
}

} // namespace torch::fft