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