Caffe2 - C++ API
A deep learning, cross platform ML framework
prelu_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 #include "caffe2/utils/math.h"
7 
8 namespace caffe2 {
9 
10 template <typename T, class Context>
11 class PReluOp final : public Operator<Context> {
12  public:
13  template <class... Args>
14  explicit PReluOp(Args&&... args)
15  : Operator<Context>(std::forward<Args>(args)...),
16  order_(StringToStorageOrder(
17  this->template GetSingleArgument<string>("order", "NCHW"))) {}
18 
19  USE_OPERATOR_CONTEXT_FUNCTIONS;
20 
21  bool RunOnDevice() override;
22 
23  protected:
24  StorageOrder order_;
25 };
26 
27 template <typename T, class Context>
28 class PReluGradientOp final : public Operator<Context> {
29  public:
30  template <class... Args>
31  explicit PReluGradientOp(Args&&... args)
32  : Operator<Context>(std::forward<Args>(args)...),
33  order_(StringToStorageOrder(
34  this->template GetSingleArgument<string>("order", "NCHW"))) {}
35  USE_OPERATOR_CONTEXT_FUNCTIONS;
36 
37  bool RunOnDevice() override;
38 
39  protected:
40  StorageOrder order_;
41 };
42 
43 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13