Skip to content

Commit 33b21c6

Browse files
committed
feat: add xlogy base
1 parent 78424f7 commit 33b21c6

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

src/base/xlogy.h

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// AUTO-GENERATED by `scripts/generate_torch_ops.py` — DO NOT EDIT.
2+
#ifndef INFINI_OPS_BASE_XLOGY_H_
3+
#define INFINI_OPS_BASE_XLOGY_H_
4+
5+
#include "operator.h"
6+
7+
namespace infini::ops {
8+
9+
class Xlogy : public Operator<Xlogy> {
10+
public:
11+
Xlogy(const Tensor input, const Tensor other, Tensor out)
12+
: input_shape_{input.shape()},
13+
input_strides_{input.strides()},
14+
input_type_{input.dtype()},
15+
other_shape_{other.shape()},
16+
other_strides_{other.strides()},
17+
other_type_{other.dtype()},
18+
out_shape_{out.shape()},
19+
out_strides_{out.strides()},
20+
out_type_{out.dtype()},
21+
device_index_{out.device().index()} {}
22+
23+
Xlogy(const Tensor input, const double other, Tensor out)
24+
: input_shape_{input.shape()},
25+
input_strides_{input.strides()},
26+
input_type_{input.dtype()},
27+
out_shape_{out.shape()},
28+
out_strides_{out.strides()},
29+
out_type_{out.dtype()},
30+
other_{other},
31+
device_index_{out.device().index()} {}
32+
33+
virtual void operator()(const Tensor input, const Tensor other, Tensor out) const = 0;
34+
35+
virtual void operator()(const Tensor input, const double other, Tensor out) const = 0;
36+
37+
protected:
38+
Tensor::Shape input_shape_;
39+
40+
Tensor::Strides input_strides_;
41+
42+
DataType input_type_;
43+
44+
Tensor::Shape other_shape_;
45+
46+
Tensor::Strides other_strides_;
47+
48+
DataType other_type_;
49+
50+
Tensor::Shape out_shape_;
51+
52+
Tensor::Strides out_strides_;
53+
54+
DataType out_type_;
55+
56+
double other_{};
57+
58+
int device_index_{0};
59+
};
60+
61+
} // namespace infini::ops
62+
63+
#endif

0 commit comments

Comments
 (0)