Skip to content

Commit 9e4815c

Browse files
authored
feat: add fft_ifft2 base (#183)
* feat: add `fft_ifft2` base * fix: add trailing newline to base header
1 parent ea9abf2 commit 9e4815c

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

src/base/fft_ifft2.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#ifndef INFINI_OPS_BASE_FFT_IFFT2_H_
2+
#define INFINI_OPS_BASE_FFT_IFFT2_H_
3+
4+
#include "operator.h"
5+
6+
namespace infini::ops {
7+
8+
class FftIfft2 : public Operator<FftIfft2> {
9+
public:
10+
FftIfft2(const Tensor input, const std::vector<int64_t> dim, Tensor out)
11+
: input_shape_{input.shape()},
12+
input_strides_{input.strides()},
13+
input_type_{input.dtype()},
14+
out_shape_{out.shape()},
15+
out_strides_{out.strides()},
16+
out_type_{out.dtype()},
17+
dim_{dim},
18+
device_index_{out.device().index()} {}
19+
20+
virtual void operator()(const Tensor input, const std::vector<int64_t> dim,
21+
Tensor out) const = 0;
22+
23+
protected:
24+
Tensor::Shape input_shape_;
25+
26+
Tensor::Strides input_strides_;
27+
28+
DataType input_type_;
29+
30+
Tensor::Shape out_shape_;
31+
32+
Tensor::Strides out_strides_;
33+
34+
DataType out_type_;
35+
36+
std::vector<int64_t> dim_{};
37+
38+
int device_index_{0};
39+
};
40+
41+
} // namespace infini::ops
42+
43+
#endif

0 commit comments

Comments
 (0)