| 4732 | class HFftFunctor { |
| 4733 | public: |
| 4734 | Maybe<Tensor> operator()(const std::shared_ptr<one::Tensor>& input, int64_t n, int64_t dim, |
| 4735 | const Optional<std::string>& norm) const { |
| 4736 | CHECK_OR_RETURN(input->dtype()->is_complex()) |
| 4737 | << "RuntimeError: expects the dtype of input Tensor is Complex, but gets " |
| 4738 | << input->dtype()->name(); |
| 4739 | |
| 4740 | std::string norm_str = norm.value_or("backward"); |
| 4741 | std::vector<int64_t> fft_dim{dim}; |
| 4742 | |
| 4743 | bool forward = true; |
| 4744 | fft_norm_mode norm_mode = fft_norm_mode::none; |
| 4745 | norm_mode = fft_norm_from_string(norm_str, forward); |
| 4746 | |
| 4747 | std::vector<int64_t> len{n}; |
| 4748 | return functional::FftC2R(input, len, fft_dim, static_cast<int32_t>(norm_mode), |
| 4749 | /*forward=*/forward, /*normalized=*/true); |
| 4750 | } |
| 4751 | }; |
| 4752 | |
| 4753 | class IHFftFunctor { |
nothing calls this directly
no test coverage detected