Caffe2 - C++ API
A deep learning, cross platform ML framework
roi_align_rotated_op.h
1 // Copyright 2004-present Facebook. All Rights Reserved.
2 
3 #ifndef ROTATED_ROI_ALIGN_OP_H_
4 #define ROTATED_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 RoIAlignRotatedOp final : public Operator<Context> {
14  public:
15  template <class... Args>
16  explicit RoIAlignRotatedOp(Args&&... args)
17  : Operator<Context>(std::forward<Args>(args)...),
18  order_(StringToStorageOrder(
19  this->template GetSingleArgument<string>("order", "NCHW"))),
20  spatial_scale_(
21  this->template GetSingleArgument<float>("spatial_scale", 1.)),
22  pooled_height_(this->template GetSingleArgument<int>("pooled_h", 1)),
23  pooled_width_(this->template GetSingleArgument<int>("pooled_w", 1)),
24  sampling_ratio_(
25  this->template GetSingleArgument<int>("sampling_ratio", -1)) {
26  DCHECK_GT(spatial_scale_, 0);
27  DCHECK_GT(pooled_height_, 0);
28  DCHECK_GT(pooled_width_, 0);
29  DCHECK_GE(sampling_ratio_, 0);
30  DCHECK(order_ == StorageOrder::NCHW || order_ == StorageOrder::NHWC);
31  }
32  USE_OPERATOR_CONTEXT_FUNCTIONS;
33 
34  bool RunOnDevice() override {
35  CAFFE_NOT_IMPLEMENTED;
36  }
37 
38  protected:
39  StorageOrder order_;
40  float spatial_scale_;
41  int pooled_height_;
42  int pooled_width_;
43  int sampling_ratio_;
44 };
45 
46 } // namespace caffe2
47 
48 #endif // ROTATED_ROI_ALIGN_OP_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13