Skip to content

Commit ac2172f

Browse files
committed
feat: add xlogy_outtensor base
1 parent 57ec7e3 commit ac2172f

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

src/base/xlogy_outtensor.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#ifndef INFINI_OPS_BASE_XLOGY_OUTTENSOR_H_
2+
#define INFINI_OPS_BASE_XLOGY_OUTTENSOR_H_
3+
4+
#include "operator.h"
5+
6+
namespace infini::ops {
7+
8+
class XlogyOuttensor : public Operator<XlogyOuttensor> {
9+
public:
10+
XlogyOuttensor(const Tensor self, const Tensor other, Tensor out)
11+
: self_shape_{self.shape()},
12+
self_strides_{self.strides()},
13+
self_type_{self.dtype()},
14+
other_shape_{other.shape()},
15+
other_strides_{other.strides()},
16+
other_type_{other.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 self, const Tensor other,
23+
Tensor out) const = 0;
24+
25+
protected:
26+
Tensor::Shape self_shape_;
27+
Tensor::Strides self_strides_;
28+
DataType self_type_;
29+
Tensor::Shape other_shape_;
30+
Tensor::Strides other_strides_;
31+
DataType other_type_;
32+
Tensor::Shape out_shape_;
33+
Tensor::Strides out_strides_;
34+
DataType out_type_;
35+
int device_index_{0};
36+
};
37+
38+
} // namespace infini::ops
39+
40+
#endif

0 commit comments

Comments
 (0)