Caffe2 - C++ API
A deep learning, cross platform ML framework
relu_dnnlowp_op.h
1 #pragma once
2 
3 #include "caffe2/operators/relu_op.h"
4 
5 #include "caffe2/core/tensor_int8.h"
6 #include "caffe2_dnnlowp_utils.h"
7 
8 namespace caffe2 {
9 
10 template <typename T>
11 class ReluDNNLowPOp final : public Operator<CPUContext> {
12  public:
13  USE_OPERATOR_FUNCTIONS(CPUContext);
14  ReluDNNLowPOp(const OperatorDef& operator_def, Workspace* ws)
15  : Operator<CPUContext>(operator_def, ws),
16  qfactory_(dnnlowp::GetQuantizationFactoryOf(this)) {}
17 
18  bool RunOnDevice() override;
19 
20  private:
21  std::unique_ptr<dnnlowp::QuantizationFactory> qfactory_;
22 };
23 
24 namespace internal {
25 
26 template <typename T>
27 void ReluAVX2(const int N, const int zero_point, const T* X, T* Y);
28 
29 } // namespace internal
30 
31 } // namespace caffe2
The CPU Context, representing the bare minimum of what a Context class in Caffe2 should implement...
Definition: context.h:40
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
Definition: workspace.h:47
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13