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