Caffe2 - C++ API
A deep learning, cross platform ML framework
activation_ops.h
1 #ifndef CAFFE2_OPENGL_OPERATORS_ACTIVATION_OPS_H_
2 #define CAFFE2_OPENGL_OPERATORS_ACTIVATION_OPS_H_
3 
4 #include "caffe2/core/context.h"
5 #include "caffe2/core/operator.h"
6 
7 namespace caffe2 {
8 
9 template <typename T>
10 class GLSigmoidOp final : public Operator<GLContext> {
11 public:
12  GLSigmoidOp(const OperatorDef &operator_def, Workspace *ws)
13  : Operator<GLContext>(operator_def, ws) {}
14  USE_OPERATOR_FUNCTIONS(GLContext);
15  bool RunOnDevice() override;
16 private:
17  arm_compute::GCActivationLayer sigmoid_layer_;
18  bool first_run_ = true, second_run_ = true;
19  GLContext::deleted_unique_ptr<const GLTensor<T>> X_;
20 };
21 
22 template <typename T> class GLReluOp final : public Operator<GLContext> {
23 public:
24  GLReluOp(const OperatorDef &operator_def, Workspace *ws)
25  : Operator<GLContext>(operator_def, ws) {}
26  virtual ~GLReluOp() noexcept {}
27  USE_OPERATOR_FUNCTIONS(GLContext);
28  bool RunOnDevice() override;
29 private:
30  arm_compute::GCActivationLayer relu_layer_;
31  bool first_run_ = true, second_run_ = true;
32  GLContext::deleted_unique_ptr<const GLTensor<T>> X_;
33 
34 };
35 
36 } // namespace caffe2
37 
38 #endif // CAFFE2_OPENGL_OPERATORS_ACTIVATION_OPS_H_
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 ...