InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
linalg_lu_factor_ex.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_LINALG_LU_FACTOR_EX_H_
2#define INFINI_OPS_BASE_LINALG_LU_FACTOR_EX_H_
3
4#include "operator.h"
5
6namespace infini::ops::linalg {
7
8class LuFactorEx : public Operator<LuFactorEx> {
9 public:
10 LuFactorEx(const Tensor A, const bool pivot, const bool check_errors,
11 Tensor LU, Tensor pivots, Tensor info)
12 : A_shape_{A.shape()},
13 A_strides_{A.strides()},
14 A_type_{A.dtype()},
15 LU_shape_{LU.shape()},
16 LU_strides_{LU.strides()},
17 LU_type_{LU.dtype()},
18 pivots_shape_{pivots.shape()},
19 pivots_strides_{pivots.strides()},
20 pivots_type_{pivots.dtype()},
21 info_shape_{info.shape()},
22 info_strides_{info.strides()},
23 info_type_{info.dtype()},
24 pivot_{pivot},
25 check_errors_{check_errors},
26 device_index_{LU.device().index()} {}
27
28 virtual void operator()(const Tensor A, const bool pivot,
29 const bool check_errors, Tensor LU, Tensor pivots,
30 Tensor info) const = 0;
31
32 protected:
33 Tensor::Shape A_shape_;
34
35 Tensor::Strides A_strides_;
36
37 DataType A_type_;
38
39 Tensor::Shape LU_shape_;
40
41 Tensor::Strides LU_strides_;
42
43 DataType LU_type_;
44
45 Tensor::Shape pivots_shape_;
46
47 Tensor::Strides pivots_strides_;
48
49 DataType pivots_type_;
50
51 Tensor::Shape info_shape_;
52
53 Tensor::Strides info_strides_;
54
55 DataType info_type_;
56
57 bool pivot_{};
58
60
62};
63
64} // namespace infini::ops::linalg
65
66#endif
Definition generated/include/operator.h:282
Definition linalg_lu_factor_ex.h:8
DataType info_type_
Definition linalg_lu_factor_ex.h:55
Tensor::Shape A_shape_
Definition linalg_lu_factor_ex.h:33
DataType A_type_
Definition linalg_lu_factor_ex.h:37
virtual void operator()(const Tensor A, const bool pivot, const bool check_errors, Tensor LU, Tensor pivots, Tensor info) const =0
bool check_errors_
Definition linalg_lu_factor_ex.h:59
DataType pivots_type_
Definition linalg_lu_factor_ex.h:49
Tensor::Strides info_strides_
Definition linalg_lu_factor_ex.h:53
Tensor::Strides A_strides_
Definition linalg_lu_factor_ex.h:35
int device_index_
Definition linalg_lu_factor_ex.h:61
DataType LU_type_
Definition linalg_lu_factor_ex.h:43
Tensor::Strides pivots_strides_
Definition linalg_lu_factor_ex.h:47
Tensor::Shape LU_shape_
Definition linalg_lu_factor_ex.h:39
bool pivot_
Definition linalg_lu_factor_ex.h:57
Tensor::Strides LU_strides_
Definition linalg_lu_factor_ex.h:41
LuFactorEx(const Tensor A, const bool pivot, const bool check_errors, Tensor LU, Tensor pivots, Tensor info)
Definition linalg_lu_factor_ex.h:10
Tensor::Shape info_shape_
Definition linalg_lu_factor_ex.h:51
Tensor::Shape pivots_shape_
Definition linalg_lu_factor_ex.h:45
Definition linalg_cholesky.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8