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

Method operator()

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

Source from the content-addressed store, hash-verified

4516class 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
4536class IFftFunctor {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected