Skip to content

Commit a115616

Browse files
committed
feat: add ormqr base
1 parent f879372 commit a115616

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

src/base/ormqr.h

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#ifndef INFINI_OPS_BASE_ORMQR_H_
2+
#define INFINI_OPS_BASE_ORMQR_H_
3+
4+
#include "operator.h"
5+
6+
namespace infini::ops {
7+
8+
class Ormqr : public Operator<Ormqr> {
9+
public:
10+
Ormqr(const Tensor input, const Tensor tau, const Tensor other,
11+
const bool left, const bool transpose, Tensor out)
12+
: input_shape_{input.shape()},
13+
input_strides_{input.strides()},
14+
input_type_{input.dtype()},
15+
tau_shape_{tau.shape()},
16+
tau_strides_{tau.strides()},
17+
tau_type_{tau.dtype()},
18+
other_shape_{other.shape()},
19+
other_strides_{other.strides()},
20+
other_type_{other.dtype()},
21+
out_shape_{out.shape()},
22+
out_strides_{out.strides()},
23+
out_type_{out.dtype()},
24+
left_{left},
25+
transpose_{transpose},
26+
device_index_{out.device().index()} {}
27+
28+
virtual void operator()(const Tensor input, const Tensor tau,
29+
const Tensor other, const bool left,
30+
const bool transpose, 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 tau_shape_;
40+
41+
Tensor::Strides tau_strides_;
42+
43+
DataType tau_type_;
44+
45+
Tensor::Shape other_shape_;
46+
47+
Tensor::Strides other_strides_;
48+
49+
DataType other_type_;
50+
51+
Tensor::Shape out_shape_;
52+
53+
Tensor::Strides out_strides_;
54+
55+
DataType out_type_;
56+
57+
bool left_{};
58+
59+
bool transpose_{};
60+
61+
int device_index_{0};
62+
};
63+
64+
} // namespace infini::ops
65+
66+
#endif

0 commit comments

Comments
 (0)