Skip to content

Commit 55706a0

Browse files
committed
feat: add BitwiseXorScalar base
1 parent 57ec7e3 commit 55706a0

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

src/base/bitwise_xor_scalar.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef INFINI_OPS_BASE_BITWISE_XOR_SCALAR_H_
2+
#define INFINI_OPS_BASE_BITWISE_XOR_SCALAR_H_
3+
4+
#include "operator.h"
5+
6+
namespace infini::ops {
7+
8+
class BitwiseXorScalar : public Operator<BitwiseXorScalar> {
9+
public:
10+
BitwiseXorScalar(const Tensor self, const double other, Tensor out)
11+
: self_shape_{self.shape()},
12+
self_strides_{self.strides()},
13+
self_type_{self.dtype()},
14+
out_shape_{out.shape()},
15+
out_strides_{out.strides()},
16+
out_type_{out.dtype()},
17+
device_index_{out.device().index()} {}
18+
19+
virtual void operator()(const Tensor self, const double other,
20+
Tensor out) const = 0;
21+
22+
protected:
23+
Tensor::Shape self_shape_;
24+
Tensor::Strides self_strides_;
25+
DataType self_type_;
26+
Tensor::Shape out_shape_;
27+
Tensor::Strides out_strides_;
28+
DataType out_type_;
29+
int device_index_{0};
30+
};
31+
32+
} // namespace infini::ops
33+
34+
#endif

0 commit comments

Comments
 (0)