Caffe2 - C++ API
A deep learning, cross platform ML framework
roi_align_gradient_op.h
1 // Copyright 2004-present Facebook. All Rights Reserved.
2 
3 #ifndef ROI_ALIGN_OP_H_
4 #define ROI_ALIGN_OP_H_
5 
6 #include "caffe2/core/context.h"
7 #include "caffe2/core/logging.h"
8 #include "caffe2/core/operator.h"
9 
10 namespace caffe2 {
11 
12 template <typename T, class Context>
13 class RoIAlignGradientOp final : public Operator<Context> {
14  public:
15  RoIAlignGradientOp(const OperatorDef& def, Workspace* ws)
16  : Operator<Context>(def, ws),
17  spatial_scale_(
18  OperatorBase::GetSingleArgument<float>("spatial_scale", 1.)),
19  pooled_height_(OperatorBase::GetSingleArgument<int>("pooled_h", 1)),
20  pooled_width_(OperatorBase::GetSingleArgument<int>("pooled_w", 1)),
21  sampling_ratio_(
22  OperatorBase::GetSingleArgument<int>("sampling_ratio", -1)) {
23  DCHECK_GT(spatial_scale_, 0);
24  DCHECK_GT(pooled_height_, 0);
25  DCHECK_GT(pooled_width_, 0);
26  DCHECK_GE(sampling_ratio_, 0);
27  }
28  USE_OPERATOR_CONTEXT_FUNCTIONS;
29 
30  bool RunOnDevice() override {
31  CAFFE_NOT_IMPLEMENTED;
32  }
33 
34  protected:
35  float spatial_scale_;
36  int pooled_height_;
37  int pooled_width_;
38  int sampling_ratio_;
39 };
40 
41 } // namespace caffe2
42 
43 #endif // ROI_ALIGN_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 ...