InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
addcdiv.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_ADDCDIV_H_
2#define INFINI_OPS_BASE_ADDCDIV_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class Addcdiv : public Operator<Addcdiv> {
9 public:
10 Addcdiv(const Tensor input, const Tensor tensor1, const Tensor tensor2,
11 const double value, Tensor out)
12 : input_shape_{input.shape()},
13 input_strides_{input.strides()},
14 input_type_{input.dtype()},
15 tensor1_shape_{tensor1.shape()},
16 tensor1_strides_{tensor1.strides()},
17 tensor1_type_{tensor1.dtype()},
18 tensor2_shape_{tensor2.shape()},
19 tensor2_strides_{tensor2.strides()},
20 tensor2_type_{tensor2.dtype()},
21 out_shape_{out.shape()},
22 out_strides_{out.strides()},
23 out_type_{out.dtype()},
24 value_{value},
25 device_index_{out.device().index()} {}
26
27 virtual void operator()(const Tensor input, const Tensor tensor1,
28 const Tensor tensor2, const double value,
29 Tensor out) const = 0;
30
31 protected:
32 Tensor::Shape input_shape_;
33
34 Tensor::Strides input_strides_;
35
36 DataType input_type_;
37
38 Tensor::Shape tensor1_shape_;
39
40 Tensor::Strides tensor1_strides_;
41
42 DataType tensor1_type_;
43
44 Tensor::Shape tensor2_shape_;
45
46 Tensor::Strides tensor2_strides_;
47
48 DataType tensor2_type_;
49
50 Tensor::Shape out_shape_;
51
52 Tensor::Strides out_strides_;
53
54 DataType out_type_;
55
56 double value_{};
57
59};
60
61} // namespace infini::ops
62
63#endif
Definition addcdiv.h:8
double value_
Definition addcdiv.h:56
Tensor::Shape tensor2_shape_
Definition addcdiv.h:44
Addcdiv(const Tensor input, const Tensor tensor1, const Tensor tensor2, const double value, Tensor out)
Definition addcdiv.h:10
Tensor::Strides tensor1_strides_
Definition addcdiv.h:40
DataType out_type_
Definition addcdiv.h:54
Tensor::Shape input_shape_
Definition addcdiv.h:32
virtual void operator()(const Tensor input, const Tensor tensor1, const Tensor tensor2, const double value, Tensor out) const =0
DataType input_type_
Definition addcdiv.h:36
Tensor::Strides input_strides_
Definition addcdiv.h:34
DataType tensor1_type_
Definition addcdiv.h:42
int device_index_
Definition addcdiv.h:58
Tensor::Shape tensor1_shape_
Definition addcdiv.h:38
Tensor::Shape out_shape_
Definition addcdiv.h:50
Tensor::Strides tensor2_strides_
Definition addcdiv.h:46
DataType tensor2_type_
Definition addcdiv.h:48
Tensor::Strides out_strides_
Definition addcdiv.h:52
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8