InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
rrelu_with_noise.h
Go to the documentation of this file.
1#ifndef INFINI_OPS_BASE_RRELU_WITH_NOISE_H_
2#define INFINI_OPS_BASE_RRELU_WITH_NOISE_H_
3
4#include "operator.h"
5
6namespace infini::ops {
7
8class RreluWithNoise : public Operator<RreluWithNoise> {
9 public:
10 RreluWithNoise(const Tensor input, const double lower, const double upper,
11 const bool training, Tensor out, Tensor noise)
12 : input_shape_{input.shape()},
13 input_strides_{input.strides()},
14 input_type_{input.dtype()},
15 noise_shape_{noise.shape()},
16 noise_strides_{noise.strides()},
17 noise_type_{noise.dtype()},
18 out_shape_{out.shape()},
19 out_strides_{out.strides()},
20 out_type_{out.dtype()},
21 lower_{lower},
22 upper_{upper},
23 training_{training},
24 device_index_{out.device().index()} {}
25
26 virtual void operator()(const Tensor input, const double lower,
27 const double upper, const bool training, Tensor out,
28 Tensor noise) const = 0;
29
30 protected:
31 Tensor::Shape input_shape_;
32
33 Tensor::Strides input_strides_;
34
35 DataType input_type_;
36
37 Tensor::Shape noise_shape_;
38
39 Tensor::Strides noise_strides_;
40
41 DataType noise_type_;
42
43 Tensor::Shape out_shape_;
44
45 Tensor::Strides out_strides_;
46
47 DataType out_type_;
48
49 double lower_{};
50
51 double upper_{};
52
53 bool training_{};
54
56};
57
58} // namespace infini::ops
59
60#endif
Definition generated/include/operator.h:282
Definition rrelu_with_noise.h:8
DataType out_type_
Definition rrelu_with_noise.h:47
double upper_
Definition rrelu_with_noise.h:51
DataType noise_type_
Definition rrelu_with_noise.h:41
Tensor::Strides noise_strides_
Definition rrelu_with_noise.h:39
int device_index_
Definition rrelu_with_noise.h:55
Tensor::Strides out_strides_
Definition rrelu_with_noise.h:45
bool training_
Definition rrelu_with_noise.h:53
double lower_
Definition rrelu_with_noise.h:49
Tensor::Shape noise_shape_
Definition rrelu_with_noise.h:37
DataType input_type_
Definition rrelu_with_noise.h:35
RreluWithNoise(const Tensor input, const double lower, const double upper, const bool training, Tensor out, Tensor noise)
Definition rrelu_with_noise.h:10
Tensor::Strides input_strides_
Definition rrelu_with_noise.h:33
Tensor::Shape out_shape_
Definition rrelu_with_noise.h:43
virtual void operator()(const Tensor input, const double lower, const double upper, const bool training, Tensor out, Tensor noise) const =0
Tensor::Shape input_shape_
Definition rrelu_with_noise.h:31
Definition generated/include/operator.h:28
infini::rt::TensorView Tensor
Definition tensor.h:8