InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
complex.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_COMPLEX_H_
2#define INFINI_OPS_BASE_COMPLEX_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class Complex : public Operator<Complex> {
9 public:
10 Complex(const Tensor real, const Tensor imag, Tensor out)
11 : real_shape_{real.shape()},
12 real_strides_{real.strides()},
13 real_type_{real.dtype()},
14 imag_shape_{imag.shape()},
15 imag_strides_{imag.strides()},
16 imag_type_{imag.dtype()},
17 out_shape_{out.shape()},
18 out_strides_{out.strides()},
19 out_type_{out.dtype()},
20 device_index_{out.device().index()} {}
21
22 virtual void operator()(const Tensor real, const Tensor imag,
23 Tensor out) const = 0;
24
25 protected:
26 Tensor::Shape real_shape_;
27
28 Tensor::Strides real_strides_;
29
30 DataType real_type_;
31
32 Tensor::Shape imag_shape_;
33
34 Tensor::Strides imag_strides_;
35
36 DataType imag_type_;
37
38 Tensor::Shape out_shape_;
39
40 Tensor::Strides out_strides_;
41
42 DataType out_type_;
43
45};
46
47} // namespace infini::ops
48
49#endif
Definition complex.h:8
int device_index_
Definition complex.h:44
Tensor::Shape out_shape_
Definition complex.h:38
DataType imag_type_
Definition complex.h:36
Tensor::Shape imag_shape_
Definition complex.h:32
Tensor::Strides real_strides_
Definition complex.h:28
virtual void operator()(const Tensor real, const Tensor imag, Tensor out) const =0
Tensor::Strides imag_strides_
Definition complex.h:34
Tensor::Shape real_shape_
Definition complex.h:26
DataType real_type_
Definition complex.h:30
Complex(const Tensor real, const Tensor imag, Tensor out)
Definition complex.h:10
DataType out_type_
Definition complex.h:42
Tensor::Strides out_strides_
Definition complex.h:40
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8