InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
mv.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_MV_H_
2#define INFINI_OPS_BASE_MV_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class Mv : public Operator<Mv> {
9 public:
10 Mv(const Tensor input, const Tensor vec, Tensor out)
11 : input_shape_{input.shape()},
12 input_strides_{input.strides()},
13 input_type_{input.dtype()},
14 vec_shape_{vec.shape()},
15 vec_strides_{vec.strides()},
16 vec_type_{vec.dtype()},
17 out_shape_{out.shape()},
18 out_strides_{out.strides()},
19 out_type_{out.dtype()},
20 device_index_{out.device().index()} {}
21
22 virtual void operator()(const Tensor input, const Tensor vec,
23 Tensor out) const = 0;
24
25 protected:
26 Tensor::Shape input_shape_;
27
28 Tensor::Strides input_strides_;
29
30 DataType input_type_;
31
32 Tensor::Shape vec_shape_;
33
34 Tensor::Strides vec_strides_;
35
36 DataType vec_type_;
37
38 Tensor::Shape out_shape_;
39
40 Tensor::Strides out_strides_;
41
42 DataType out_type_;
43
45};
46
47} // namespace infini::ops
48
49#endif
Definition mv.h:8
DataType out_type_
Definition mv.h:42
Tensor::Strides vec_strides_
Definition mv.h:34
Tensor::Strides input_strides_
Definition mv.h:28
Tensor::Shape out_shape_
Definition mv.h:38
Mv(const Tensor input, const Tensor vec, Tensor out)
Definition mv.h:10
DataType input_type_
Definition mv.h:30
Tensor::Shape vec_shape_
Definition mv.h:32
Tensor::Shape input_shape_
Definition mv.h:26
virtual void operator()(const Tensor input, const Tensor vec, Tensor out) const =0
int device_index_
Definition mv.h:44
Tensor::Strides out_strides_
Definition mv.h:40
DataType vec_type_
Definition mv.h:36
Definition generated/include/operator.h:282
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8