MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / operator()

Method operator()

oneflow/core/functional/impl/math_functor.cpp:4755–4772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4753class IHFftFunctor {
4754 public:
4755 Maybe<Tensor> operator()(const std::shared_ptr<one::Tensor>& input, int64_t n, int64_t dim,
4756 const Optional<std::string>& norm) const {
4757 CHECK_OR_RETURN(!(input->dtype()->is_complex()))
4758 << "RuntimeError: expects the dtype of input Tensor is Real, but gets "
4759 << input->dtype()->name();
4760
4761 std::string norm_str = norm.value_or("backward");
4762 std::vector<int64_t> fft_dim{dim};
4763
4764 bool forward = false;
4765 fft_norm_mode norm_mode = fft_norm_mode::none;
4766 norm_mode = fft_norm_from_string(norm_str, forward);
4767
4768 std::vector<int64_t> len{n};
4769 return functional::FftR2C(input, len, fft_dim, static_cast<int32_t>(norm_mode),
4770 /*onesided=*/true,
4771 /*forward=*/forward, /*normalized=*/true);
4772 }
4773};
4774
4775class HFft2Functor {

Callers

nothing calls this directly

Calls 6

fft_norm_from_stringFunction · 0.85
FftR2CClass · 0.85
is_complexMethod · 0.45
dtypeMethod · 0.45
nameMethod · 0.45
value_orMethod · 0.45

Tested by

no test coverage detected