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