Caffe2 - C++ API
A deep learning, cross platform ML framework
elementwise_linear_dnnlowp_op.h
1 
17 #pragma once
18 
19 #include "caffe2/operators/elementwise_linear_op.h"
20 #include "caffe2/quantization/server/dnnlowp_op.h"
21 
22 namespace caffe2 {
23 
24 using ElementwiseLinearFp32Op = ElementwiseLinearOp<float, CPUContext>;
25 
26 template <typename T>
28  : public DNNLowPOp<T, ElementwiseLinearFp32Op> {
29  public:
30  ElementwiseLinearDNNLowPOp(const OperatorDef& operator_def, Workspace* ws);
31  bool RunOnDevice() override;
32 
33  USE_OPERATOR_FUNCTIONS(CPUContext);
34  USE_DNNLOWP_OPERATOR_BASE_FUNCTIONS(T, ElementwiseLinearFp32Op);
35 
36  private:
37  bool GetQuantizationParameters_();
38 
39  int axis_;
40 
41  dnnlowp::RequantizationParams requantization_params_;
42 
43  std::vector<T> a_quantized_;
44 };
45 
46 } // 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
A convenient base class for C2 operators with DNNLOWP engine.
Definition: dnnlowp_op.h:77