InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
lt.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_LT_H_
2#define INFINI_OPS_BASE_LT_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class Lt : public Operator<Lt> {
9 public:
10 Lt(const Tensor input, const double other, Tensor out)
11 : input_shape_{input.shape()},
12 input_strides_{input.strides()},
13 input_type_{input.dtype()},
14 out_shape_{out.shape()},
15 out_strides_{out.strides()},
16 out_type_{out.dtype()},
17 other_{other},
18 device_index_{out.device().index()} {}
19
20 Lt(const Tensor input, const Tensor other, Tensor out)
21 : input_shape_{input.shape()},
22 input_strides_{input.strides()},
23 input_type_{input.dtype()},
24 out_shape_{out.shape()},
25 out_strides_{out.strides()},
26 out_type_{out.dtype()},
27 other_shape_{other.shape()},
28 other_strides_{other.strides()},
29 other_type_{other.dtype()},
30 device_index_{out.device().index()} {}
31
34 [[deprecated("Use the explicit-output overload instead.")]]
35 Lt(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 Lt(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 double other,
55 Tensor out) const = 0;
56
57 virtual void operator()(const Tensor input, const Tensor 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 out_shape_;
78
79 Tensor::Strides out_strides_;
80
81 DataType out_type_;
82
83 double other_{};
84
85 Tensor::Shape other_shape_;
86
87 Tensor::Strides other_strides_;
88
89 DataType other_type_;
90
92};
93
94} // namespace infini::ops
95
96#endif
Definition lt.h:8
Tensor::Shape out_shape_
Definition lt.h:77
Tensor::Strides out_strides_
Definition lt.h:79
Tensor::Shape other_shape_
Definition lt.h:85
DataType input_type_
Definition lt.h:75
virtual void operator()(Tensor input, const Tensor other) const =0
Tensor::Strides other_strides_
Definition lt.h:87
Lt(Tensor input, const Tensor other)
Definition lt.h:45
DataType out_type_
Definition lt.h:81
Lt(const Tensor input, const Tensor other, Tensor out)
Definition lt.h:20
int device_index_
Definition lt.h:91
Lt(const Tensor input, const double other, Tensor out)
Definition lt.h:10
virtual void operator()(Tensor input, const double other) const =0
DataType other_type_
Definition lt.h:89
double other_
Definition lt.h:83
virtual void operator()(const Tensor input, const double other, Tensor out) const =0
Lt(Tensor input, const double other)
Definition lt.h:35
Tensor::Strides input_strides_
Definition lt.h:73
Tensor::Shape input_shape_
Definition lt.h:71
virtual void operator()(const Tensor input, const Tensor other, Tensor out) const =0
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8