InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
linalg_lu.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_LINALG_LU_H_
2#define INFINI_OPS_BASE_LINALG_LU_H_
3
4#include "operator.h"
5
6namespace infini::ops::linalg {
7
8class Lu : public Operator<Lu> {
9 public:
10 Lu(const Tensor A, const bool pivot, Tensor P, Tensor L, Tensor U)
11 : A_shape_{A.shape()},
12 A_strides_{A.strides()},
13 A_type_{A.dtype()},
14 P_shape_{P.shape()},
15 P_strides_{P.strides()},
16 P_type_{P.dtype()},
17 L_shape_{L.shape()},
18 L_strides_{L.strides()},
19 L_type_{L.dtype()},
20 U_shape_{U.shape()},
21 U_strides_{U.strides()},
22 U_type_{U.dtype()},
23 pivot_{pivot},
24 device_index_{P.device().index()} {}
25
26 virtual void operator()(const Tensor A, const bool pivot, Tensor P, Tensor L,
27 Tensor U) const = 0;
28
29 protected:
30 Tensor::Shape A_shape_;
31
32 Tensor::Strides A_strides_;
33
34 DataType A_type_;
35
36 Tensor::Shape P_shape_;
37
38 Tensor::Strides P_strides_;
39
40 DataType P_type_;
41
42 Tensor::Shape L_shape_;
43
44 Tensor::Strides L_strides_;
45
46 DataType L_type_;
47
48 Tensor::Shape U_shape_;
49
50 Tensor::Strides U_strides_;
51
52 DataType U_type_;
53
54 bool pivot_{};
55
57};
58
59} // namespace infini::ops::linalg
60
61#endif
Definition generated/include/operator.h:282
Definition linalg_lu.h:8
DataType U_type_
Definition linalg_lu.h:52
bool pivot_
Definition linalg_lu.h:54
Lu(const Tensor A, const bool pivot, Tensor P, Tensor L, Tensor U)
Definition linalg_lu.h:10
Tensor::Shape P_shape_
Definition linalg_lu.h:36
DataType A_type_
Definition linalg_lu.h:34
Tensor::Shape L_shape_
Definition linalg_lu.h:42
DataType L_type_
Definition linalg_lu.h:46
Tensor::Shape A_shape_
Definition linalg_lu.h:30
int device_index_
Definition linalg_lu.h:56
Tensor::Shape U_shape_
Definition linalg_lu.h:48
DataType P_type_
Definition linalg_lu.h:40
virtual void operator()(const Tensor A, const bool pivot, Tensor P, Tensor L, Tensor U) const =0
Tensor::Strides A_strides_
Definition linalg_lu.h:32
Tensor::Strides P_strides_
Definition linalg_lu.h:38
Tensor::Strides U_strides_
Definition linalg_lu.h:50
Tensor::Strides L_strides_
Definition linalg_lu.h:44
Definition linalg_cholesky.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8