InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
bitwise_left_shift.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_BITWISE_LEFT_SHIFT_H_
2#define INFINI_OPS_BASE_BITWISE_LEFT_SHIFT_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class BitwiseLeftShift : public Operator<BitwiseLeftShift> {
9 public:
10 BitwiseLeftShift(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 BitwiseLeftShift(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 BitwiseLeftShift(Tensor input, const Tensor other)
36 : input_shape_{input.shape()},
37 input_strides_{input.strides()},
38 input_type_{input.dtype()},
39 other_shape_{other.shape()},
40 other_strides_{other.strides()},
41 other_type_{other.dtype()},
42 device_index_{input.device().index()} {}
43
46 [[deprecated("Use the explicit-output overload instead.")]]
47 BitwiseLeftShift(Tensor input, const double other)
48 : input_shape_{input.shape()},
49 input_strides_{input.strides()},
50 input_type_{input.dtype()},
51 other_{other},
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 Tensor other) const = 0;
64
67 [[deprecated("Use an explicit-output overload instead.")]]
68 virtual void operator()(Tensor input, const double 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_left_shift.h:8
int device_index_
Definition bitwise_left_shift.h:91
Tensor::Strides out_strides_
Definition bitwise_left_shift.h:85
Tensor::Shape out_shape_
Definition bitwise_left_shift.h:83
virtual void operator()(const Tensor input, const double other, Tensor out) const =0
Tensor::Strides input_strides_
Definition bitwise_left_shift.h:73
DataType input_type_
Definition bitwise_left_shift.h:75
virtual void operator()(Tensor input, const Tensor other) const =0
BitwiseLeftShift(Tensor input, const Tensor other)
Definition bitwise_left_shift.h:35
Tensor::Strides other_strides_
Definition bitwise_left_shift.h:79
double other_
Definition bitwise_left_shift.h:89
DataType other_type_
Definition bitwise_left_shift.h:81
Tensor::Shape input_shape_
Definition bitwise_left_shift.h:71
virtual void operator()(Tensor input, const double other) const =0
DataType out_type_
Definition bitwise_left_shift.h:87
BitwiseLeftShift(const Tensor input, const Tensor other, Tensor out)
Definition bitwise_left_shift.h:10
BitwiseLeftShift(Tensor input, const double other)
Definition bitwise_left_shift.h:47
virtual void operator()(const Tensor input, const Tensor other, Tensor out) const =0
BitwiseLeftShift(const Tensor input, const double other, Tensor out)
Definition bitwise_left_shift.h:22
Tensor::Shape other_shape_
Definition bitwise_left_shift.h:77
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8