Caffe2 - C++ API
A deep learning, cross platform ML framework
spatial_narrow_as_op.h
1 
17 #ifndef SPATIAL_NARROW_AS_OP_H_
18 #define SPATIAL_NARROW_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 <class Context>
28 class SpatialNarrowAsOp final : public Operator<Context> {
29  public:
30  SpatialNarrowAsOp(const OperatorDef& operator_def, Workspace* ws)
31  : Operator<Context>(operator_def, ws) {}
32  USE_OPERATOR_CONTEXT_FUNCTIONS;
33  USE_DISPATCH_HELPER;
34  bool RunOnDevice() override {
35  // No CPU implementation for now
36  CAFFE_NOT_IMPLEMENTED;
37  }
38 
39  protected:
40  template <typename T>
41  bool DoRunWithType();
42 };
43 
44 template <class Context>
45 class SpatialNarrowAsGradientOp final : public Operator<Context> {
46  public:
47  SpatialNarrowAsGradientOp(const OperatorDef& def, Workspace* ws)
48  : Operator<Context>(def, ws) {}
49  USE_OPERATOR_CONTEXT_FUNCTIONS;
50  USE_DISPATCH_HELPER;
51  bool RunOnDevice() override {
52  // No CPU implementation for now
53  CAFFE_NOT_IMPLEMENTED;
54  }
55 
56  protected:
57  template <typename T>
58  bool DoRunWithType();
59 };
60 
61 } // namespace caffe2
62 
63 #endif // SPATIAL_NARROW_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