Skip to content

Commit 08133b0

Browse files
committed
feat: add qr base
1 parent cfea02e commit 08133b0

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

src/base/qr.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#ifndef INFINI_OPS_BASE_QR_H_
2+
#define INFINI_OPS_BASE_QR_H_
3+
4+
#include "operator.h"
5+
6+
namespace infini::ops {
7+
8+
class Qr : public Operator<Qr> {
9+
public:
10+
Qr(const Tensor input, const bool some, Tensor Q, Tensor R)
11+
: input_shape_{input.shape()},
12+
input_strides_{input.strides()},
13+
input_type_{input.dtype()},
14+
Q_shape_{Q.shape()},
15+
Q_strides_{Q.strides()},
16+
Q_type_{Q.dtype()},
17+
R_shape_{R.shape()},
18+
R_strides_{R.strides()},
19+
R_type_{R.dtype()},
20+
some_{some},
21+
device_index_{Q.device().index()} {}
22+
23+
virtual void operator()(const Tensor input, const bool some, Tensor Q,
24+
Tensor R) const = 0;
25+
26+
protected:
27+
Tensor::Shape input_shape_;
28+
29+
Tensor::Strides input_strides_;
30+
31+
DataType input_type_;
32+
33+
Tensor::Shape Q_shape_;
34+
35+
Tensor::Strides Q_strides_;
36+
37+
DataType Q_type_;
38+
39+
Tensor::Shape R_shape_;
40+
41+
Tensor::Strides R_strides_;
42+
43+
DataType R_type_;
44+
45+
bool some_{};
46+
47+
int device_index_{0};
48+
};
49+
50+
} // namespace infini::ops
51+
52+
#endif

0 commit comments

Comments
 (0)