InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
svd.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_SVD_H_
2#define INFINI_OPS_BASE_SVD_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class Svd : public Operator<Svd> {
9 public:
10 Svd(const Tensor input, const bool some, const bool compute_uv, Tensor U,
11 Tensor S, Tensor V)
12 : input_shape_{input.shape()},
13 input_strides_{input.strides()},
14 input_type_{input.dtype()},
15 U_shape_{U.shape()},
16 U_strides_{U.strides()},
17 U_type_{U.dtype()},
18 S_shape_{S.shape()},
19 S_strides_{S.strides()},
20 S_type_{S.dtype()},
21 V_shape_{V.shape()},
22 V_strides_{V.strides()},
23 V_type_{V.dtype()},
24 some_{some},
25 compute_uv_{compute_uv},
26 device_index_{U.device().index()} {}
27
28 virtual void operator()(const Tensor input, const bool some,
29 const bool compute_uv, Tensor U, Tensor S,
30 Tensor V) const = 0;
31
32 protected:
33 Tensor::Shape input_shape_;
34
35 Tensor::Strides input_strides_;
36
37 DataType input_type_;
38
39 Tensor::Shape U_shape_;
40
41 Tensor::Strides U_strides_;
42
43 DataType U_type_;
44
45 Tensor::Shape S_shape_;
46
47 Tensor::Strides S_strides_;
48
49 DataType S_type_;
50
51 Tensor::Shape V_shape_;
52
53 Tensor::Strides V_strides_;
54
55 DataType V_type_;
56
57 bool some_{};
58
60
62};
63
64} // namespace infini::ops
65
66#endif
Definition generated/include/operator.h:282
Definition svd.h:8
Tensor::Shape input_shape_
Definition svd.h:33
virtual void operator()(const Tensor input, const bool some, const bool compute_uv, Tensor U, Tensor S, Tensor V) const =0
Svd(const Tensor input, const bool some, const bool compute_uv, Tensor U, Tensor S, Tensor V)
Definition svd.h:10
DataType S_type_
Definition svd.h:49
Tensor::Strides S_strides_
Definition svd.h:47
int device_index_
Definition svd.h:61
DataType V_type_
Definition svd.h:55
DataType U_type_
Definition svd.h:43
bool compute_uv_
Definition svd.h:59
bool some_
Definition svd.h:57
Tensor::Strides input_strides_
Definition svd.h:35
Tensor::Strides U_strides_
Definition svd.h:41
DataType input_type_
Definition svd.h:37
Tensor::Strides V_strides_
Definition svd.h:53
Tensor::Shape U_shape_
Definition svd.h:39
Tensor::Shape S_shape_
Definition svd.h:45
Tensor::Shape V_shape_
Definition svd.h:51
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8