Caffe2 - C++ API
A deep learning, cross platform ML framework
elu_op.h
1 #pragma once
2 
3 #include "caffe2/core/context.h"
4 #include "caffe2/core/logging.h"
5 #include "caffe2/core/operator.h"
6 
7 namespace caffe2 {
8 
9 template <typename T, class Context>
10 class EluOp final : public Operator<Context> {
11  public:
12  EluOp(const OperatorDef& operator_def, Workspace* ws)
13  : Operator<Context>(operator_def, ws),
14  alpha_(OperatorBase::GetSingleArgument<float>("alpha", 1.0)) {}
15  USE_OPERATOR_CONTEXT_FUNCTIONS;
16 
17  bool RunOnDevice() override;
18 
19  protected:
20  T alpha_;
21 };
22 
23 template <typename T, class Context>
24 class EluGradientOp final : public Operator<Context> {
25  public:
26  EluGradientOp(const OperatorDef& operator_def, Workspace* ws)
27  : Operator<Context>(operator_def, ws),
28  alpha_(OperatorBase::GetSingleArgument<float>("alpha", 1.0)) {}
29  USE_OPERATOR_CONTEXT_FUNCTIONS;
30 
31  bool RunOnDevice() override;
32 
33  protected:
34  T alpha_;
35 };
36 
37 } // namespace caffe2
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 ...