InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
bitwise_xor.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_BITWISE_XOR_H_
2#define INFINI_OPS_BASE_BITWISE_XOR_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class BitwiseXor : public Operator<BitwiseXor> {
9 public:
10 BitwiseXor(const Tensor input, const Tensor other, Tensor out)
11 : input_shape_{input.shape()},
12 input_strides_{input.strides()},
13 input_type_{input.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 BitwiseXor(const Tensor input, const double other, Tensor out)
23 : input_shape_{input.shape()},
24 input_strides_{input.strides()},
25 input_type_{input.dtype()},
26 out_shape_{out.shape()},
27 out_strides_{out.strides()},
28 out_type_{out.dtype()},
29 other_{other},
30 device_index_{out.device().index()} {}
31
34 [[deprecated("Use the explicit-output overload instead.")]]
35 BitwiseXor(Tensor input, const double other)
36 : input_shape_{input.shape()},
37 input_strides_{input.strides()},
38 input_type_{input.dtype()},
39 other_{other},
40 device_index_{input.device().index()} {}
41
44 [[deprecated("Use the explicit-output overload instead.")]]
45 BitwiseXor(Tensor input, const Tensor other)
46 : input_shape_{input.shape()},
47 input_strides_{input.strides()},
48 input_type_{input.dtype()},
49 other_shape_{other.shape()},
50 other_strides_{other.strides()},
51 other_type_{other.dtype()},
52 device_index_{input.device().index()} {}
53
54 virtual void operator()(const Tensor input, const Tensor other,
55 Tensor out) const = 0;
56
57 virtual void operator()(const Tensor input, const double other,
58 Tensor out) const = 0;
59
62 [[deprecated("Use an explicit-output overload instead.")]]
63 virtual void operator()(Tensor input, const double other) const = 0;
64
67 [[deprecated("Use an explicit-output overload instead.")]]
68 virtual void operator()(Tensor input, const Tensor other) const = 0;
69
70 protected:
71 Tensor::Shape input_shape_;
72
73 Tensor::Strides input_strides_;
74
75 DataType input_type_;
76
77 Tensor::Shape other_shape_;
78
79 Tensor::Strides other_strides_;
80
81 DataType other_type_;
82
83 Tensor::Shape out_shape_;
84
85 Tensor::Strides out_strides_;
86
87 DataType out_type_;
88
89 double other_{};
90
92};
93
94} // namespace infini::ops
95
96#endif
Definition bitwise_xor.h:8
BitwiseXor(Tensor input, const Tensor other)
Definition bitwise_xor.h:45
double other_
Definition bitwise_xor.h:89
virtual void operator()(Tensor input, const double other) const =0
Tensor::Shape out_shape_
Definition bitwise_xor.h:83
Tensor::Shape other_shape_
Definition bitwise_xor.h:77
BitwiseXor(const Tensor input, const double other, Tensor out)
Definition bitwise_xor.h:22
BitwiseXor(const Tensor input, const Tensor other, Tensor out)
Definition bitwise_xor.h:10
BitwiseXor(Tensor input, const double other)
Definition bitwise_xor.h:35
Tensor::Strides input_strides_
Definition bitwise_xor.h:73
DataType out_type_
Definition bitwise_xor.h:87
Tensor::Shape input_shape_
Definition bitwise_xor.h:71
Tensor::Strides other_strides_
Definition bitwise_xor.h:79
DataType input_type_
Definition bitwise_xor.h:75
DataType other_type_
Definition bitwise_xor.h:81
int device_index_
Definition bitwise_xor.h:91
virtual void operator()(const Tensor input, const Tensor other, Tensor out) const =0
virtual void operator()(Tensor input, const Tensor other) const =0
virtual void operator()(const Tensor input, const double other, Tensor out) const =0
Tensor::Strides out_strides_
Definition bitwise_xor.h:85
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8