Caffe2 - C++ API
A deep learning, cross platform ML framework
sample_as_op.h
1 
17 #ifndef SAMPLE_AS_OP_H_
18 #define SAMPLE_AS_OP_H_
19 
20 #include "caffe2/core/context.h"
21 #include "caffe2/core/logging.h"
22 #include "caffe2/core/operator.h"
23 #include "caffe2/utils/math.h"
24 
25 namespace caffe2 {
26 
27 template <typename T, class Context>
28 class SampleAsOp final : public Operator<Context> {
29  public:
30  SampleAsOp(const OperatorDef& operator_def, Workspace* ws)
31  : Operator<Context>(operator_def, ws) {}
32  USE_OPERATOR_CONTEXT_FUNCTIONS;
33 
34  bool RunOnDevice() override {
35  // No CPU implementation for now
36  CAFFE_NOT_IMPLEMENTED;
37  }
38 };
39 
40 template <typename T, class Context>
41 class SampleAsGradientOp final : public Operator<Context> {
42  public:
43  SampleAsGradientOp(const OperatorDef& def, Workspace* ws)
44  : Operator<Context>(def, ws) {}
45  USE_OPERATOR_CONTEXT_FUNCTIONS;
46 
47  bool RunOnDevice() override {
48  // No CPU implementation for now
49  CAFFE_NOT_IMPLEMENTED;
50  }
51 };
52 
53 } // namespace caffe2
54 
55 #endif // SAMPLE_AS_OP_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 ...
Definition: blob.h:13