experimental_detectron_roi_feature.hpp
1 //*****************************************************************************
2 // Copyright 2017-2021 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //*****************************************************************************
16 
17 #pragma once
18 
19 #include <cstddef>
20 #include <cstdint>
21 #include <vector>
22 #include "ngraph/attribute_adapter.hpp"
23 #include "ngraph/op/op.hpp"
24 #include "ngraph/op/util/attr_types.hpp"
25 
26 namespace ngraph
27 {
28  namespace op
29  {
30  namespace v6
31  {
32  /// \brief An operation ExperimentalDetectronROIFeatureExtractor, according to
33  /// the repository https://github.com/openvinotoolkit/training_extensions (see the file
34  /// pytorch_toolkit/instance_segmentation/segmentoly/rcnn/roi_feature_extractor.py).
35  class NGRAPH_API ExperimentalDetectronROIFeatureExtractor : public Op
36  {
37  public:
38  NGRAPH_RTTI_DECLARATION;
39 
40  /// \brief Structure that specifies attributes of the operation
41  struct Attributes
42  {
43  int64_t output_size;
44  int64_t sampling_ratio;
45  std::vector<int64_t> pyramid_scales;
46  bool aligned;
47  };
48 
50  /// \brief Constructs a ExperimentalDetectronROIFeatureExtractor operation.
51  ///
52  /// \param args Inputs of ExperimentalDetectronROIFeatureExtractor
53  /// \param attrs Operation attributes
54  ExperimentalDetectronROIFeatureExtractor(const OutputVector& args,
55  const Attributes& attrs);
56 
57  /// \brief Constructs a ExperimentalDetectronROIFeatureExtractor operation.
58  ///
59  /// \param args Inputs of ExperimentalDetectronROIFeatureExtractor
60  /// \param attrs Operation attributes
62  const Attributes& attrs);
63  bool visit_attributes(AttributeVisitor& visitor) override;
64 
65  void validate_and_infer_types() override;
66 
67  std::shared_ptr<Node>
68  clone_with_new_inputs(const OutputVector& new_args) const override;
69  /// \brief Returns attributes of the operation.
70  const Attributes& get_attrs() const { return m_attrs; }
71  private:
72  Attributes m_attrs;
73  };
74  }
75  }
76 }
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:71
Root of all actual ops.
Definition: op.hpp:29
An operation ExperimentalDetectronROIFeatureExtractor, according to the repository https://github....
Definition: experimental_detectron_roi_feature.hpp:36
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
ExperimentalDetectronROIFeatureExtractor(const NodeVector &args, const Attributes &attrs)
Constructs a ExperimentalDetectronROIFeatureExtractor operation.
const Attributes & get_attrs() const
Returns attributes of the operation.
Definition: experimental_detectron_roi_feature.hpp:70
ExperimentalDetectronROIFeatureExtractor(const OutputVector &args, const Attributes &attrs)
Constructs a ExperimentalDetectronROIFeatureExtractor operation.
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
Structure that specifies attributes of the operation.
Definition: experimental_detectron_roi_feature.hpp:42