InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
linalg_solve.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_LINALG_SOLVE_H_
2#define INFINI_OPS_BASE_LINALG_SOLVE_H_
3
4#include "operator.h"
5
6namespace infini::ops::linalg {
7
8class Solve : public Operator<Solve> {
9 public:
10 Solve(const Tensor A, const Tensor B, const bool left, Tensor out)
11 : A_shape_{A.shape()},
12 A_strides_{A.strides()},
13 A_type_{A.dtype()},
14 B_shape_{B.shape()},
15 B_strides_{B.strides()},
16 B_type_{B.dtype()},
17 out_shape_{out.shape()},
18 out_strides_{out.strides()},
19 out_type_{out.dtype()},
20 left_{left},
21 device_index_{out.device().index()} {}
22
23 virtual void operator()(const Tensor A, const Tensor B, const bool left,
24 Tensor out) 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 B_shape_;
34
35 Tensor::Strides B_strides_;
36
37 DataType B_type_;
38
39 Tensor::Shape out_shape_;
40
41 Tensor::Strides out_strides_;
42
43 DataType out_type_;
44
45 bool left_{};
46
48};
49
50} // namespace infini::ops::linalg
51
52#endif
Definition generated/include/operator.h:282
Definition linalg_solve.h:8
Solve(const Tensor A, const Tensor B, const bool left, Tensor out)
Definition linalg_solve.h:10
Tensor::Shape out_shape_
Definition linalg_solve.h:39
Tensor::Shape B_shape_
Definition linalg_solve.h:33
DataType A_type_
Definition linalg_solve.h:31
Tensor::Strides A_strides_
Definition linalg_solve.h:29
Tensor::Strides out_strides_
Definition linalg_solve.h:41
DataType out_type_
Definition linalg_solve.h:43
Tensor::Strides B_strides_
Definition linalg_solve.h:35
bool left_
Definition linalg_solve.h:45
virtual void operator()(const Tensor A, const Tensor B, const bool left, Tensor out) const =0
Tensor::Shape A_shape_
Definition linalg_solve.h:27
int device_index_
Definition linalg_solve.h:47
DataType B_type_
Definition linalg_solve.h:37
Definition linalg_cholesky.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8