InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
internal_linalg_eigh.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_INTERNAL_LINALG_EIGH_H_
2#define INFINI_OPS_BASE_INTERNAL_LINALG_EIGH_H_
3
4#include <string>
5
6#include "operator.h"
7
9
10class Eigh : public Operator<Eigh> {
11 public:
12 Eigh(const Tensor A, const std::string UPLO, const bool compute_v,
13 Tensor eigenvalues, Tensor eigenvectors)
14 : A_shape_{A.shape()},
15 A_strides_{A.strides()},
16 A_type_{A.dtype()},
17 eigenvalues_shape_{eigenvalues.shape()},
18 eigenvalues_strides_{eigenvalues.strides()},
19 eigenvalues_type_{eigenvalues.dtype()},
20 eigenvectors_shape_{eigenvectors.shape()},
21 eigenvectors_strides_{eigenvectors.strides()},
22 eigenvectors_type_{eigenvectors.dtype()},
23 UPLO_{UPLO},
24 compute_v_{compute_v},
25 device_index_{eigenvalues.device().index()} {}
26
27 virtual void operator()(const Tensor A, const std::string UPLO,
28 const bool compute_v, Tensor eigenvalues,
29 Tensor eigenvectors) const = 0;
30
31 protected:
32 Tensor::Shape A_shape_;
33
34 Tensor::Strides A_strides_;
35
36 DataType A_type_;
37
38 Tensor::Shape eigenvalues_shape_;
39
40 Tensor::Strides eigenvalues_strides_;
41
43
44 Tensor::Shape eigenvectors_shape_;
45
46 Tensor::Strides eigenvectors_strides_;
47
49
50 std::string UPLO_{};
51
52 bool compute_v_{};
53
55};
56
57} // namespace infini::ops::internal::linalg
58
59#endif
Definition generated/include/operator.h:282
Definition internal_linalg_eigh.h:10
Tensor::Shape eigenvalues_shape_
Definition internal_linalg_eigh.h:38
Eigh(const Tensor A, const std::string UPLO, const bool compute_v, Tensor eigenvalues, Tensor eigenvectors)
Definition internal_linalg_eigh.h:12
Tensor::Strides A_strides_
Definition internal_linalg_eigh.h:34
DataType A_type_
Definition internal_linalg_eigh.h:36
Tensor::Shape A_shape_
Definition internal_linalg_eigh.h:32
DataType eigenvalues_type_
Definition internal_linalg_eigh.h:42
int device_index_
Definition internal_linalg_eigh.h:54
DataType eigenvectors_type_
Definition internal_linalg_eigh.h:48
virtual void operator()(const Tensor A, const std::string UPLO, const bool compute_v, Tensor eigenvalues, Tensor eigenvectors) const =0
Tensor::Strides eigenvalues_strides_
Definition internal_linalg_eigh.h:40
Tensor::Strides eigenvectors_strides_
Definition internal_linalg_eigh.h:46
Tensor::Shape eigenvectors_shape_
Definition internal_linalg_eigh.h:44
bool compute_v_
Definition internal_linalg_eigh.h:52
std::string UPLO_
Definition internal_linalg_eigh.h:50
Definition internal_linalg_det.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8