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

Method operator()

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

Source from the content-addressed store, hash-verified

4732class 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
4753class IHFftFunctor {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected