| 4516 | class FftFunctor { |
| 4517 | public: |
| 4518 | Maybe<Tensor> operator()(const std::shared_ptr<one::Tensor>& input, int64_t n, int64_t dim, |
| 4519 | const Optional<std::string>& norm) const { |
| 4520 | std::string norm_str = norm.value_or("backward"); |
| 4521 | std::vector<int64_t> fft_dim{dim}; |
| 4522 | |
| 4523 | bool forward = true; |
| 4524 | fft_norm_mode norm_mode = fft_norm_mode::none; |
| 4525 | norm_mode = fft_norm_from_string(norm_str, forward); |
| 4526 | |
| 4527 | std::vector<int64_t> len{n}; |
| 4528 | return input->dtype()->is_complex() |
| 4529 | ? functional::FftC2C(input, len, fft_dim, static_cast<int32_t>(norm_mode), |
| 4530 | /*forward=*/forward, /*normalized=*/true) |
| 4531 | : functional::FftR2C(input, len, fft_dim, static_cast<int32_t>(norm_mode), |
| 4532 | /*onesided=*/false, /*forward=*/forward, /*normalized=*/true); |
| 4533 | } |
| 4534 | }; |
| 4535 | |
| 4536 | class IFftFunctor { |
nothing calls this directly
no test coverage detected