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

Method operator()

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

Source from the content-addressed store, hash-verified

4637class RFftFunctor {
4638 public:
4639 Maybe<Tensor> operator()(const std::shared_ptr<one::Tensor>& input, int64_t n, int64_t dim,
4640 const Optional<std::string>& norm) const {
4641 CHECK_OR_RETURN(!(input->dtype()->is_complex()))
4642 << "RuntimeError: expects the dtype of input Tensor is Real, but gets "
4643 << input->dtype()->name();
4644
4645 std::string norm_str = norm.value_or("backward");
4646 std::vector<int64_t> fft_dim{dim};
4647 bool forward = true;
4648 fft_norm_mode norm_mode = fft_norm_mode::none;
4649 norm_mode = fft_norm_from_string(norm_str, forward);
4650
4651 std::vector<int64_t> len{n};
4652 return functional::FftR2C(input, len, fft_dim, static_cast<int32_t>(norm_mode),
4653 /*onesided=*/true, /*forward=*/forward, /*normalized=*/true);
4654 }
4655};
4656
4657class IRFftFunctor {

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