InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
linalg_qr.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_LINALG_QR_H_
2#define INFINI_OPS_BASE_LINALG_QR_H_
3
4#include <string>
5
6#include "operator.h"
7
8namespace infini::ops::linalg {
9
10class Qr : public Operator<Qr> {
11 public:
12 Qr(const Tensor A, const std::string mode, Tensor Q, Tensor R)
13 : A_shape_{A.shape()},
14 A_strides_{A.strides()},
15 A_type_{A.dtype()},
16 Q_shape_{Q.shape()},
17 Q_strides_{Q.strides()},
18 Q_type_{Q.dtype()},
19 R_shape_{R.shape()},
20 R_strides_{R.strides()},
21 R_type_{R.dtype()},
22 mode_{mode},
23 device_index_{Q.device().index()} {}
24
25 virtual void operator()(const Tensor A, const std::string mode, Tensor Q,
26 Tensor R) const = 0;
27
28 protected:
29 Tensor::Shape A_shape_;
30
31 Tensor::Strides A_strides_;
32
33 DataType A_type_;
34
35 Tensor::Shape Q_shape_;
36
37 Tensor::Strides Q_strides_;
38
39 DataType Q_type_;
40
41 Tensor::Shape R_shape_;
42
43 Tensor::Strides R_strides_;
44
45 DataType R_type_;
46
47 std::string mode_{};
48
50};
51
52} // namespace infini::ops::linalg
53
54#endif
Definition generated/include/operator.h:282
Definition linalg_qr.h:10
Tensor::Strides A_strides_
Definition linalg_qr.h:31
Tensor::Shape R_shape_
Definition linalg_qr.h:41
Tensor::Shape A_shape_
Definition linalg_qr.h:29
int device_index_
Definition linalg_qr.h:49
DataType Q_type_
Definition linalg_qr.h:39
DataType A_type_
Definition linalg_qr.h:33
Tensor::Strides R_strides_
Definition linalg_qr.h:43
Qr(const Tensor A, const std::string mode, Tensor Q, Tensor R)
Definition linalg_qr.h:12
virtual void operator()(const Tensor A, const std::string mode, Tensor Q, Tensor R) const =0
std::string mode_
Definition linalg_qr.h:47
Tensor::Shape Q_shape_
Definition linalg_qr.h:35
Tensor::Strides Q_strides_
Definition linalg_qr.h:37
DataType R_type_
Definition linalg_qr.h:45
Definition linalg_cholesky.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8