InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
linalg_vecdot.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_LINALG_VECDOT_H_
2#define INFINI_OPS_BASE_LINALG_VECDOT_H_
3
4#include "operator.h"
5
6namespace infini::ops::linalg {
7
8class Vecdot : public Operator<Vecdot> {
9 public:
10 Vecdot(const Tensor x, const Tensor y, const int64_t dim, Tensor out)
11 : x_shape_{x.shape()},
12 x_strides_{x.strides()},
13 x_type_{x.dtype()},
14 y_shape_{y.shape()},
15 y_strides_{y.strides()},
16 y_type_{y.dtype()},
17 out_shape_{out.shape()},
18 out_strides_{out.strides()},
19 out_type_{out.dtype()},
20 dim_{dim},
21 device_index_{out.device().index()} {}
22
23 virtual void operator()(const Tensor x, const Tensor y, const int64_t dim,
24 Tensor out) const = 0;
25
26 protected:
27 Tensor::Shape x_shape_;
28
29 Tensor::Strides x_strides_;
30
31 DataType x_type_;
32
33 Tensor::Shape y_shape_;
34
35 Tensor::Strides y_strides_;
36
37 DataType y_type_;
38
39 Tensor::Shape out_shape_;
40
41 Tensor::Strides out_strides_;
42
43 DataType out_type_;
44
45 int64_t dim_{};
46
48};
49
50} // namespace infini::ops::linalg
51
52#endif
Definition generated/include/operator.h:282
Definition linalg_vecdot.h:8
DataType x_type_
Definition linalg_vecdot.h:31
virtual void operator()(const Tensor x, const Tensor y, const int64_t dim, Tensor out) const =0
Tensor::Strides y_strides_
Definition linalg_vecdot.h:35
Tensor::Strides out_strides_
Definition linalg_vecdot.h:41
DataType y_type_
Definition linalg_vecdot.h:37
Tensor::Shape y_shape_
Definition linalg_vecdot.h:33
int device_index_
Definition linalg_vecdot.h:47
Tensor::Shape x_shape_
Definition linalg_vecdot.h:27
Vecdot(const Tensor x, const Tensor y, const int64_t dim, Tensor out)
Definition linalg_vecdot.h:10
DataType out_type_
Definition linalg_vecdot.h:43
Tensor::Strides x_strides_
Definition linalg_vecdot.h:29
int64_t dim_
Definition linalg_vecdot.h:45
Tensor::Shape out_shape_
Definition linalg_vecdot.h:39
Definition linalg_cholesky.h:6
infini::rt::TensorView Tensor
Definition tensor.h:8