Caffe2 - C++ API
A deep learning, cross platform ML framework
elu_op.h
1 #ifndef CAFFE2_OPERATORS_ELU_OP_H_
2 #define CAFFE2_OPERATORS_ELU_OP_H_
3 
4 #include <vector>
5 
6 #include "caffe2/operators/elementwise_ops.h"
7 
8 namespace caffe2 {
9 
10 template <class Context>
11 struct EluFunctor {
12  explicit EluFunctor(OperatorBase& op)
13  : alpha(op.GetSingleArgument<float>("alpha", 1.0f)) {}
14 
15  template <typename T>
16  bool operator()(const int N, const T* X, T* Y, Context* context) const;
17 
18  const float alpha;
19 };
20 
21 template <class Context>
23  explicit EluGradientFunctor(OperatorBase& op)
24  : alpha(op.GetSingleArgument<float>("alpha", 1.0f)) {}
25 
26  template <typename T>
27  bool Forward(
28  const std::vector<int>& Y_dims,
29  const std::vector<int>& dY_dims,
30  const T* Y,
31  const T* dY,
32  T* dX,
33  Context* context) const;
34 
35  const float alpha;
36 };
37 
38 } // namespace caffe2
39 
40 #endif // CAFFE2_OPERATORS_ELU_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13