reorg_yolo.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/op/op.hpp"
8 
9 namespace ngraph
10 {
11  namespace op
12  {
13  namespace v0
14  {
15  class NGRAPH_API ReorgYolo : public Op
16  {
17  public:
18  static constexpr NodeTypeInfo type_info{"ReorgYolo", 0};
19  const NodeTypeInfo& get_type_info() const override { return type_info; }
20  ReorgYolo() = default;
21  /// \brief Constructs a ReorgYolo operation
22  ///
23  /// \param input Input
24  /// \param stride Stride to reorganize input by
25  ReorgYolo(const Output<Node>& input, const size_t stride);
26 
27  // Constructor with `strides` for backward compatibility
28  ReorgYolo(const Output<Node>& input, const Strides& strides);
29 
30  void validate_and_infer_types() override;
31 
32  virtual bool visit_attributes(AttributeVisitor& visitor) override;
33 
34  virtual std::shared_ptr<Node>
35  clone_with_new_inputs(const OutputVector& new_args) const override;
36 
37  Strides get_strides() const { return m_strides; }
38 
39  private:
40  Strides m_strides;
41  };
42  } // namespace v0
43  using v0::ReorgYolo;
44  } // namespace op
45 } // namespace ngraph
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:59
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Strides for a tensor.
Definition: strides.hpp:18
Root of all actual ops.
Definition: op.hpp:17
Definition: reorg_yolo.hpp:16
ReorgYolo(const Output< Node > &input, const size_t stride)
Constructs a ReorgYolo operation.
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
const NodeTypeInfo & get_type_info() const override
Definition: reorg_yolo.hpp:19
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27