diff --git a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/fully_connected.hpp b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/fully_connected.hpp index c492897d747..484a0a0ea3f 100644 --- a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/fully_connected.hpp +++ b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/fully_connected.hpp @@ -13,6 +13,7 @@ namespace MKLDNNPlugin { class FullyConnectedNode : public ngraph::op::Op { public: static constexpr ngraph::NodeTypeInfo type_info{"FullyConnected", 0}; + static constexpr const ::ngraph::Node::type_info_t& get_type_info_static() { return type_info; } const ngraph::NodeTypeInfo& get_type_info() const override { return type_info; } FullyConnectedNode() = default; diff --git a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/leaky_relu.hpp b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/leaky_relu.hpp index 3465ffc7510..7a4cfec982e 100644 --- a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/leaky_relu.hpp +++ b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/leaky_relu.hpp @@ -11,6 +11,7 @@ namespace MKLDNNPlugin { class LeakyReluNode : public ngraph::op::Op { public: static constexpr ngraph::NodeTypeInfo type_info{"LeakyRelu", 0}; + static constexpr const ::ngraph::Node::type_info_t& get_type_info_static() { return type_info; } const ngraph::NodeTypeInfo& get_type_info() const override { return type_info; } LeakyReluNode(const ngraph::Output &data, const float &negative_slope, const ngraph::element::Type output_type); diff --git a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/power_static.hpp b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/power_static.hpp index e43a54c4e03..cb71b59c723 100644 --- a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/power_static.hpp +++ b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/power_static.hpp @@ -11,6 +11,7 @@ namespace MKLDNNPlugin { class PowerStaticNode : public ngraph::op::Op { public: static constexpr ngraph::NodeTypeInfo type_info{"PowerStatic", 0}; + static constexpr const ::ngraph::Node::type_info_t& get_type_info_static() { return type_info; } const ngraph::NodeTypeInfo& get_type_info() const override { return type_info; } PowerStaticNode(const ngraph::Output &data, const float &power, const float &scale, const float &shift, diff --git a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/swish_cpu.hpp b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/swish_cpu.hpp index 3ff1c30a1ad..9477af47f84 100644 --- a/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/swish_cpu.hpp +++ b/inference-engine/src/mkldnn_plugin/ngraph_transformations/op/swish_cpu.hpp @@ -11,6 +11,7 @@ namespace MKLDNNPlugin { class SwishNode : public ngraph::op::Op { public: static constexpr ngraph::NodeTypeInfo type_info{"SwishCPU", 0}; + static constexpr const ::ngraph::Node::type_info_t& get_type_info_static() { return type_info; } const ngraph::NodeTypeInfo &get_type_info() const override { return type_info; } explicit SwishNode(const ngraph::Output &input, float alpha = 1.0); diff --git a/ngraph/core/include/ngraph/op/binary_convolution.hpp b/ngraph/core/include/ngraph/op/binary_convolution.hpp index 3d4bf98496e..b866066da55 100644 --- a/ngraph/core/include/ngraph/op/binary_convolution.hpp +++ b/ngraph/core/include/ngraph/op/binary_convolution.hpp @@ -17,8 +17,8 @@ namespace ngraph class NGRAPH_API BinaryConvolution : public Op { public: - static constexpr NodeTypeInfo type_info{"BinaryConvolution", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + enum class BinaryConvolutionMode { // Interpret input data and kernel values: 0 as -1, 1 as 1 diff --git a/ngraph/core/include/ngraph/op/broadcast.hpp b/ngraph/core/include/ngraph/op/broadcast.hpp index 17fc97b43a2..665668bcab6 100644 --- a/ngraph/core/include/ngraph/op/broadcast.hpp +++ b/ngraph/core/include/ngraph/op/broadcast.hpp @@ -85,8 +85,8 @@ namespace ngraph class NGRAPH_API Broadcast : public util::BroadcastBase { public: - static constexpr NodeTypeInfo type_info{"Broadcast", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs a broadcast operation. Broadcast() = default; /// \brief Constructs a broadcast operation. diff --git a/ngraph/core/include/ngraph/op/constant.hpp b/ngraph/core/include/ngraph/op/constant.hpp index 69b77dbcaf4..ce75a674452 100644 --- a/ngraph/core/include/ngraph/op/constant.hpp +++ b/ngraph/core/include/ngraph/op/constant.hpp @@ -26,8 +26,8 @@ namespace ngraph class NGRAPH_API Constant : public Op { public: - static constexpr NodeTypeInfo type_info{"Constant", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + Constant() = default; /// \brief Initialize a constant from tensor diff --git a/ngraph/core/include/ngraph/op/convert_like.hpp b/ngraph/core/include/ngraph/op/convert_like.hpp index addea41e26a..bb14805ab1b 100644 --- a/ngraph/core/include/ngraph/op/convert_like.hpp +++ b/ngraph/core/include/ngraph/op/convert_like.hpp @@ -16,8 +16,8 @@ namespace ngraph class NGRAPH_API ConvertLike : public Op { public: - static constexpr NodeTypeInfo type_info{"ConvertLike", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs a conversion operation. ConvertLike() = default; /// \brief Constructs a conversion operation. diff --git a/ngraph/core/include/ngraph/op/ctc_greedy_decoder.hpp b/ngraph/core/include/ngraph/op/ctc_greedy_decoder.hpp index 09780c06b74..832724ae0b6 100644 --- a/ngraph/core/include/ngraph/op/ctc_greedy_decoder.hpp +++ b/ngraph/core/include/ngraph/op/ctc_greedy_decoder.hpp @@ -15,8 +15,8 @@ namespace ngraph class NGRAPH_API CTCGreedyDecoder : public Op { public: - static constexpr NodeTypeInfo type_info{"CTCGreedyDecoder", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + CTCGreedyDecoder() = default; /// \brief Constructs a CTCGreedyDecoder operation /// diff --git a/ngraph/core/include/ngraph/op/deformable_convolution.hpp b/ngraph/core/include/ngraph/op/deformable_convolution.hpp index 8a62337a610..158a9742049 100644 --- a/ngraph/core/include/ngraph/op/deformable_convolution.hpp +++ b/ngraph/core/include/ngraph/op/deformable_convolution.hpp @@ -18,8 +18,8 @@ namespace ngraph class NGRAPH_API DeformableConvolution : public Op { public: - static constexpr NodeTypeInfo type_info{"DeformableConvolution", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs a conversion operation. DeformableConvolution() = default; /// \brief Constructs a conversion operation. diff --git a/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp b/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp index 93177b79f55..bb48f914853 100644 --- a/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp +++ b/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp @@ -15,8 +15,8 @@ namespace ngraph class NGRAPH_API DeformablePSROIPooling : public Op { public: - static constexpr NodeTypeInfo type_info{"DeformablePSROIPooling", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + DeformablePSROIPooling() = default; /// \brief Constructs a DeformablePSROIPooling operation /// diff --git a/ngraph/core/include/ngraph/op/detection_output.hpp b/ngraph/core/include/ngraph/op/detection_output.hpp index a07a6d06173..bd92bacbc15 100644 --- a/ngraph/core/include/ngraph/op/detection_output.hpp +++ b/ngraph/core/include/ngraph/op/detection_output.hpp @@ -37,8 +37,8 @@ namespace ngraph class NGRAPH_API DetectionOutput : public Op { public: - static constexpr NodeTypeInfo type_info{"DetectionOutput", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + DetectionOutput() = default; /// \brief Constructs a DetectionOutput operation /// diff --git a/ngraph/core/include/ngraph/op/elu.hpp b/ngraph/core/include/ngraph/op/elu.hpp index 3b15c52bb73..fb4f60b93bb 100644 --- a/ngraph/core/include/ngraph/op/elu.hpp +++ b/ngraph/core/include/ngraph/op/elu.hpp @@ -20,8 +20,8 @@ namespace ngraph class NGRAPH_API Elu : public ngraph::op::Op { public: - static constexpr NodeTypeInfo type_info{"Elu", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + Elu() = default; /// \brief Constructs an Elu operation. /// diff --git a/ngraph/core/include/ngraph/op/gather_tree.hpp b/ngraph/core/include/ngraph/op/gather_tree.hpp index b8bc687a187..a1c94f899a0 100644 --- a/ngraph/core/include/ngraph/op/gather_tree.hpp +++ b/ngraph/core/include/ngraph/op/gather_tree.hpp @@ -17,8 +17,8 @@ namespace ngraph class NGRAPH_API GatherTree : public Op { public: - static constexpr NodeTypeInfo type_info{"GatherTree", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + GatherTree() = default; /// \param step_ids Tensor of shape [MAX_TIME, BATCH_SIZE, BEAM_WIDTH] with /// indices from per each step diff --git a/ngraph/core/include/ngraph/op/grn.hpp b/ngraph/core/include/ngraph/op/grn.hpp index d34312703fb..1defa7098d1 100644 --- a/ngraph/core/include/ngraph/op/grn.hpp +++ b/ngraph/core/include/ngraph/op/grn.hpp @@ -22,8 +22,8 @@ namespace ngraph class NGRAPH_API GRN : public ngraph::op::util::FusedOp { public: - static constexpr NodeTypeInfo type_info{"GRN", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + GRN(); /// \brief Constructs a GRN operation. /// diff --git a/ngraph/core/include/ngraph/op/hard_sigmoid.hpp b/ngraph/core/include/ngraph/op/hard_sigmoid.hpp index 587e1932fbe..2aa112e960d 100644 --- a/ngraph/core/include/ngraph/op/hard_sigmoid.hpp +++ b/ngraph/core/include/ngraph/op/hard_sigmoid.hpp @@ -21,8 +21,8 @@ namespace ngraph class NGRAPH_API HardSigmoid : public ngraph::op::util::FusedOp { public: - static constexpr NodeTypeInfo type_info{"HardSigmoid", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + HardSigmoid(); /// \brief Constructs a HardSigmoid operation. diff --git a/ngraph/core/include/ngraph/op/lrn.hpp b/ngraph/core/include/ngraph/op/lrn.hpp index 76443b221a9..cf539fa2ce2 100644 --- a/ngraph/core/include/ngraph/op/lrn.hpp +++ b/ngraph/core/include/ngraph/op/lrn.hpp @@ -30,8 +30,8 @@ namespace ngraph class NGRAPH_API LRN : public Op { public: - static constexpr NodeTypeInfo type_info{"LRN", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs a LRN operation. LRN() = default; /// \brief Constructs a LRN operation. diff --git a/ngraph/core/include/ngraph/op/lstm_cell.hpp b/ngraph/core/include/ngraph/op/lstm_cell.hpp index 5e39cfff684..439916a6f31 100644 --- a/ngraph/core/include/ngraph/op/lstm_cell.hpp +++ b/ngraph/core/include/ngraph/op/lstm_cell.hpp @@ -58,8 +58,8 @@ namespace ngraph class NGRAPH_API LSTMCell : public util::RNNCellBase { public: - static constexpr NodeTypeInfo type_info{"LSTMCell", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + LSTMCell(); /// /// \brief Constructs LSTMCell node. @@ -280,8 +280,8 @@ namespace ngraph class NGRAPH_API LSTMCell : public util::RNNCellBase { public: - static constexpr NodeTypeInfo type_info{"LSTMCell", 4}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + LSTMCell(); /// /// \brief Constructs LSTMCell node. diff --git a/ngraph/core/include/ngraph/op/non_max_suppression.hpp b/ngraph/core/include/ngraph/op/non_max_suppression.hpp index 9b2136d24d5..96a4b969def 100644 --- a/ngraph/core/include/ngraph/op/non_max_suppression.hpp +++ b/ngraph/core/include/ngraph/op/non_max_suppression.hpp @@ -23,8 +23,8 @@ namespace ngraph CENTER }; - static constexpr NodeTypeInfo type_info{"NonMaxSuppression", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + NonMaxSuppression() = default; /// \brief Constructs a NonMaxSuppression operation. diff --git a/ngraph/core/include/ngraph/op/one_hot.hpp b/ngraph/core/include/ngraph/op/one_hot.hpp index 604b9db202c..ca0ac72b2da 100644 --- a/ngraph/core/include/ngraph/op/one_hot.hpp +++ b/ngraph/core/include/ngraph/op/one_hot.hpp @@ -15,8 +15,8 @@ namespace ngraph class NGRAPH_API OneHot : public Op { public: - static constexpr NodeTypeInfo type_info{"OneHot", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs a one-hot operation. OneHot() = default; /// \brief Constructs a one-hot operation. diff --git a/ngraph/core/include/ngraph/op/pad.hpp b/ngraph/core/include/ngraph/op/pad.hpp index 9f0b94cf16c..4b67ee73310 100644 --- a/ngraph/core/include/ngraph/op/pad.hpp +++ b/ngraph/core/include/ngraph/op/pad.hpp @@ -18,8 +18,8 @@ namespace ngraph class NGRAPH_API Pad : public Op { public: - static constexpr NodeTypeInfo type_info{"Pad", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs a generic padding operation. /// /// \param arg The output producing input tensor to be padded. diff --git a/ngraph/core/include/ngraph/op/prior_box.hpp b/ngraph/core/include/ngraph/op/prior_box.hpp index 02c29a46a1b..0b6f0771b06 100644 --- a/ngraph/core/include/ngraph/op/prior_box.hpp +++ b/ngraph/core/include/ngraph/op/prior_box.hpp @@ -42,8 +42,8 @@ namespace ngraph class NGRAPH_API PriorBox : public Op { public: - static constexpr NodeTypeInfo type_info{"PriorBox", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + PriorBox() = default; /// \brief Constructs a PriorBox operation /// diff --git a/ngraph/core/include/ngraph/op/prior_box_clustered.hpp b/ngraph/core/include/ngraph/op/prior_box_clustered.hpp index 47dd59584a5..0c6d170bb87 100644 --- a/ngraph/core/include/ngraph/op/prior_box_clustered.hpp +++ b/ngraph/core/include/ngraph/op/prior_box_clustered.hpp @@ -35,8 +35,8 @@ namespace ngraph class NGRAPH_API PriorBoxClustered : public Op { public: - static constexpr NodeTypeInfo type_info{"PriorBoxClustered", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + PriorBoxClustered() = default; /// \brief Constructs a PriorBoxClustered operation /// diff --git a/ngraph/core/include/ngraph/op/psroi_pooling.hpp b/ngraph/core/include/ngraph/op/psroi_pooling.hpp index ca7162a824a..0740bfc9007 100644 --- a/ngraph/core/include/ngraph/op/psroi_pooling.hpp +++ b/ngraph/core/include/ngraph/op/psroi_pooling.hpp @@ -15,8 +15,8 @@ namespace ngraph class NGRAPH_API PSROIPooling : public Op { public: - static constexpr NodeTypeInfo type_info{"PSROIPooling", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + PSROIPooling() = default; /// \brief Constructs a PSROIPooling operation /// diff --git a/ngraph/core/include/ngraph/op/range.hpp b/ngraph/core/include/ngraph/op/range.hpp index a63d6fac7c5..22fe1b5302b 100644 --- a/ngraph/core/include/ngraph/op/range.hpp +++ b/ngraph/core/include/ngraph/op/range.hpp @@ -57,8 +57,8 @@ namespace ngraph class NGRAPH_API Range : public Op { public: - static constexpr NodeTypeInfo type_info{"Range", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs an unitialized range operation. Range() = default; diff --git a/ngraph/core/include/ngraph/op/region_yolo.hpp b/ngraph/core/include/ngraph/op/region_yolo.hpp index feee9b41114..fa863c83bdd 100644 --- a/ngraph/core/include/ngraph/op/region_yolo.hpp +++ b/ngraph/core/include/ngraph/op/region_yolo.hpp @@ -15,8 +15,8 @@ namespace ngraph class NGRAPH_API RegionYolo : public Op { public: - static constexpr NodeTypeInfo type_info{"RegionYolo", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + RegionYolo() = default; /// /// \brief Constructs a RegionYolo operation diff --git a/ngraph/core/include/ngraph/op/reorg_yolo.hpp b/ngraph/core/include/ngraph/op/reorg_yolo.hpp index 1e8467ae0b3..64bd77013f9 100644 --- a/ngraph/core/include/ngraph/op/reorg_yolo.hpp +++ b/ngraph/core/include/ngraph/op/reorg_yolo.hpp @@ -15,8 +15,8 @@ namespace ngraph class NGRAPH_API ReorgYolo : public Op { public: - static constexpr NodeTypeInfo type_info{"ReorgYolo", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + ReorgYolo() = default; /// \brief Constructs a ReorgYolo operation /// diff --git a/ngraph/core/include/ngraph/op/reverse_sequence.hpp b/ngraph/core/include/ngraph/op/reverse_sequence.hpp index 0e5fe300528..6b1cff233a4 100644 --- a/ngraph/core/include/ngraph/op/reverse_sequence.hpp +++ b/ngraph/core/include/ngraph/op/reverse_sequence.hpp @@ -15,8 +15,8 @@ namespace ngraph class NGRAPH_API ReverseSequence : public Op { public: - static constexpr NodeTypeInfo type_info{"ReverseSequence", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + ReverseSequence() = default; /// \brief Constructs a ReverseSequence operation. /// diff --git a/ngraph/core/include/ngraph/op/rnn_cell.hpp b/ngraph/core/include/ngraph/op/rnn_cell.hpp index e01793ccf88..779171ec785 100644 --- a/ngraph/core/include/ngraph/op/rnn_cell.hpp +++ b/ngraph/core/include/ngraph/op/rnn_cell.hpp @@ -41,8 +41,8 @@ namespace ngraph class NGRAPH_API RNNCell : public util::RNNCellBase { public: - static constexpr NodeTypeInfo type_info{"RNNCell", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + RNNCell(); /// /// \brief Constructs RNNCell node. diff --git a/ngraph/core/include/ngraph/op/space_to_depth.hpp b/ngraph/core/include/ngraph/op/space_to_depth.hpp index f6ae3bd9b01..1cd775a878f 100644 --- a/ngraph/core/include/ngraph/op/space_to_depth.hpp +++ b/ngraph/core/include/ngraph/op/space_to_depth.hpp @@ -24,8 +24,8 @@ namespace ngraph class NGRAPH_API SpaceToDepth : public Op { public: - static constexpr NodeTypeInfo type_info{"SpaceToDepth", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + enum class SpaceToDepthMode { // The output depth is gathered from [block_size, ..., block_size, C] diff --git a/ngraph/core/include/ngraph/op/tensor_iterator.hpp b/ngraph/core/include/ngraph/op/tensor_iterator.hpp index 84330483aca..de44f4b638e 100644 --- a/ngraph/core/include/ngraph/op/tensor_iterator.hpp +++ b/ngraph/core/include/ngraph/op/tensor_iterator.hpp @@ -20,8 +20,8 @@ namespace ngraph class NGRAPH_API TensorIterator : public op::util::SubGraphOp { public: - static constexpr NodeTypeInfo type_info{"TensorIterator", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + bool visit_attributes(AttributeVisitor& visitor) override; TensorIterator() = default; diff --git a/ngraph/core/include/ngraph/op/tile.hpp b/ngraph/core/include/ngraph/op/tile.hpp index 5ea0fe343ad..6dff6de4785 100644 --- a/ngraph/core/include/ngraph/op/tile.hpp +++ b/ngraph/core/include/ngraph/op/tile.hpp @@ -18,8 +18,8 @@ namespace ngraph class NGRAPH_API Tile : public Op { public: - static constexpr NodeTypeInfo type_info{"Tile", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + Tile() = default; /// \brief Perform dynamic padding of a tensor /// diff --git a/ngraph/core/include/ngraph/op/util/broadcast_base.hpp b/ngraph/core/include/ngraph/op/util/broadcast_base.hpp index 4c5b4f82402..c5f671a7434 100644 --- a/ngraph/core/include/ngraph/op/util/broadcast_base.hpp +++ b/ngraph/core/include/ngraph/op/util/broadcast_base.hpp @@ -44,6 +44,8 @@ namespace ngraph const BroadcastModeSpec& broadcast_mode = BroadcastType::NUMPY); public: + NGRAPH_RTTI_DECLARATION; + void validate_and_infer_types() override; /// \return true and the AxisSet if broadcast axes can be fully determined. virtual std::pair get_broadcast_axes() const; diff --git a/ngraph/core/include/ngraph/op/util/fused_op.hpp b/ngraph/core/include/ngraph/op/util/fused_op.hpp index f20069c4328..8db8707e94f 100644 --- a/ngraph/core/include/ngraph/op/util/fused_op.hpp +++ b/ngraph/core/include/ngraph/op/util/fused_op.hpp @@ -21,6 +21,8 @@ namespace ngraph : public Op { public: + NGRAPH_RTTI_DECLARATION; + // Fused op decomposition can be performed in the presence of // partial shapes virtual bool can_decompose_with_partial_shapes() { return false; } diff --git a/ngraph/core/include/ngraph/op/util/rnn_cell_base.hpp b/ngraph/core/include/ngraph/op/util/rnn_cell_base.hpp index 3cee5671385..ff5479884a5 100644 --- a/ngraph/core/include/ngraph/op/util/rnn_cell_base.hpp +++ b/ngraph/core/include/ngraph/op/util/rnn_cell_base.hpp @@ -54,6 +54,8 @@ namespace ngraph class NGRAPH_API RNNCellBase : public Op { public: + NGRAPH_RTTI_DECLARATION; + /// /// \brief Constructs a RNNCellBase class. /// @@ -87,7 +89,7 @@ namespace ngraph /// void validate_input_rank_dimension(const std::vector& input); - virtual bool visit_attributes(AttributeVisitor& visitor); + bool visit_attributes(AttributeVisitor& visitor) override; std::size_t get_hidden_size() const { return m_hidden_size; } float get_clip() const { return m_clip; } const std::vector& get_activations() const { return m_activations; } diff --git a/ngraph/core/src/op/binary_convolution.cpp b/ngraph/core/src/op/binary_convolution.cpp index 57ce4b9b222..0d9790ce6a1 100644 --- a/ngraph/core/src/op/binary_convolution.cpp +++ b/ngraph/core/src/op/binary_convolution.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v1::BinaryConvolution::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::BinaryConvolution, "BinaryConvolution", 1); op::v1::BinaryConvolution::BinaryConvolution(const Output& data, const Output& kernel, diff --git a/ngraph/core/src/op/broadcast.cpp b/ngraph/core/src/op/broadcast.cpp index 2df01eb9075..81993720203 100644 --- a/ngraph/core/src/op/broadcast.cpp +++ b/ngraph/core/src/op/broadcast.cpp @@ -245,7 +245,7 @@ namespace } } // namespace -constexpr NodeTypeInfo op::v1::Broadcast::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::Broadcast, "Broadcast", 1, op::util::BroadcastBase); op::v1::Broadcast::Broadcast(const Output& arg, const Output& target_shape, diff --git a/ngraph/core/src/op/constant.cpp b/ngraph/core/src/op/constant.cpp index 1578ba63050..1e638896a2f 100644 --- a/ngraph/core/src/op/constant.cpp +++ b/ngraph/core/src/op/constant.cpp @@ -38,7 +38,7 @@ static inline string to_cpp_string(T value) return rc; } -constexpr NodeTypeInfo op::Constant::type_info; +NGRAPH_RTTI_DEFINITION(op::Constant, "Constant", 0); op::Constant::Constant(const shared_ptr& tensor) : Constant(tensor->get_element_type(), tensor->get_shape()) diff --git a/ngraph/core/src/op/convert_like.cpp b/ngraph/core/src/op/convert_like.cpp index 24a3a1c63cf..fd8aa3c3e7d 100644 --- a/ngraph/core/src/op/convert_like.cpp +++ b/ngraph/core/src/op/convert_like.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v1::ConvertLike::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::ConvertLike, "ConvertLike", 1); op::v1::ConvertLike::ConvertLike(const Output& data, const Output& like) : Op({data, like}) diff --git a/ngraph/core/src/op/ctc_greedy_decoder.cpp b/ngraph/core/src/op/ctc_greedy_decoder.cpp index ca6afc6258e..fe27b1046f8 100644 --- a/ngraph/core/src/op/ctc_greedy_decoder.cpp +++ b/ngraph/core/src/op/ctc_greedy_decoder.cpp @@ -8,7 +8,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::CTCGreedyDecoder::type_info; +NGRAPH_RTTI_DEFINITION(op::CTCGreedyDecoder, "CTCGreedyDecoder", 0); op::CTCGreedyDecoder::CTCGreedyDecoder(const Output& input, const Output& seq_len, diff --git a/ngraph/core/src/op/deformable_convolution.cpp b/ngraph/core/src/op/deformable_convolution.cpp index 5893a33a928..7a7278b2449 100644 --- a/ngraph/core/src/op/deformable_convolution.cpp +++ b/ngraph/core/src/op/deformable_convolution.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v1::DeformableConvolution::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::DeformableConvolution, "DeformableConvolution", 1); op::v1::DeformableConvolution::DeformableConvolution(const Output& arg, const Output& offsets, diff --git a/ngraph/core/src/op/deformable_psroi_pooling.cpp b/ngraph/core/src/op/deformable_psroi_pooling.cpp index 651d38694ee..0052063074a 100644 --- a/ngraph/core/src/op/deformable_psroi_pooling.cpp +++ b/ngraph/core/src/op/deformable_psroi_pooling.cpp @@ -8,7 +8,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v1::DeformablePSROIPooling::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::DeformablePSROIPooling, "DeformablePSROIPooling", 1); op::v1::DeformablePSROIPooling::DeformablePSROIPooling(const Output& input, const Output& coords, diff --git a/ngraph/core/src/op/detection_output.cpp b/ngraph/core/src/op/detection_output.cpp index f9dc5bbcb68..88c80732915 100644 --- a/ngraph/core/src/op/detection_output.cpp +++ b/ngraph/core/src/op/detection_output.cpp @@ -8,7 +8,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::DetectionOutput::type_info; +NGRAPH_RTTI_DEFINITION(op::DetectionOutput, "DetectionOutput", 0); op::DetectionOutput::DetectionOutput(const Output& box_logits, const Output& class_preds, diff --git a/ngraph/core/src/op/elu.cpp b/ngraph/core/src/op/elu.cpp index bb5cf5834de..dda70bf46d0 100644 --- a/ngraph/core/src/op/elu.cpp +++ b/ngraph/core/src/op/elu.cpp @@ -11,7 +11,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::Elu::type_info; +NGRAPH_RTTI_DEFINITION(op::Elu, "Elu", 0); op::Elu::Elu(const Output& data, const double alpha) : Op({data}) diff --git a/ngraph/core/src/op/gather_tree.cpp b/ngraph/core/src/op/gather_tree.cpp index 710ec6f23d7..1ac45a0d4af 100644 --- a/ngraph/core/src/op/gather_tree.cpp +++ b/ngraph/core/src/op/gather_tree.cpp @@ -9,7 +9,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v1::GatherTree::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::GatherTree, "GatherTree", 1); op::v1::GatherTree::GatherTree(const Output& step_ids, const Output& parent_idx, diff --git a/ngraph/core/src/op/grn.cpp b/ngraph/core/src/op/grn.cpp index 367d5eafaa1..5bb6c47616e 100644 --- a/ngraph/core/src/op/grn.cpp +++ b/ngraph/core/src/op/grn.cpp @@ -22,7 +22,7 @@ using namespace ngraph; NGRAPH_SUPPRESS_DEPRECATED_START -constexpr NodeTypeInfo op::GRN::type_info; +NGRAPH_RTTI_DEFINITION(op::GRN, "GRN", 0, op::util::FusedOp); op::GRN::GRN() : FusedOp() diff --git a/ngraph/core/src/op/hard_sigmoid.cpp b/ngraph/core/src/op/hard_sigmoid.cpp index 4e2f24f6cd2..2cdef578245 100644 --- a/ngraph/core/src/op/hard_sigmoid.cpp +++ b/ngraph/core/src/op/hard_sigmoid.cpp @@ -18,7 +18,7 @@ using namespace ngraph; NGRAPH_SUPPRESS_DEPRECATED_START -constexpr NodeTypeInfo op::HardSigmoid::type_info; +NGRAPH_RTTI_DEFINITION(op::HardSigmoid, "HardSigmoid", 0, op::util::FusedOp); op::HardSigmoid::HardSigmoid() : FusedOp() diff --git a/ngraph/core/src/op/lrn.cpp b/ngraph/core/src/op/lrn.cpp index da85ec66bca..5ec95f53fb0 100644 --- a/ngraph/core/src/op/lrn.cpp +++ b/ngraph/core/src/op/lrn.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::LRN::type_info; +NGRAPH_RTTI_DEFINITION(op::LRN, "LRN", 0); op::LRN::LRN(const Output& arg, double alpha, double beta, double bias, size_t size) : LRN(arg, op::Constant::create(element::i64, Shape{1}, {1}), alpha, beta, bias, size) diff --git a/ngraph/core/src/op/lstm_cell.cpp b/ngraph/core/src/op/lstm_cell.cpp index 47deac08939..73bc2138549 100644 --- a/ngraph/core/src/op/lstm_cell.cpp +++ b/ngraph/core/src/op/lstm_cell.cpp @@ -16,8 +16,8 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v4::LSTMCell::type_info; -constexpr NodeTypeInfo op::v0::LSTMCell::type_info; +NGRAPH_RTTI_DEFINITION(op::v0::LSTMCell, "LSTMCell", 0, op::util::RNNCellBase); +NGRAPH_RTTI_DEFINITION(op::v4::LSTMCell, "LSTMCell", 4, op::util::RNNCellBase); op::v0::LSTMCell::LSTMCell() : m_input_forget(false) diff --git a/ngraph/core/src/op/non_max_suppression.cpp b/ngraph/core/src/op/non_max_suppression.cpp index 19359bfa6c8..4e11d27b9f7 100644 --- a/ngraph/core/src/op/non_max_suppression.cpp +++ b/ngraph/core/src/op/non_max_suppression.cpp @@ -18,7 +18,7 @@ using namespace ngraph; // ------------------------------ V1 ------------------------------ -constexpr NodeTypeInfo op::v1::NonMaxSuppression::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::NonMaxSuppression, "NonMaxSuppression", 1); op::v1::NonMaxSuppression::NonMaxSuppression( const Output& boxes, diff --git a/ngraph/core/src/op/one_hot.cpp b/ngraph/core/src/op/one_hot.cpp index d70e9847428..f4a9797068b 100644 --- a/ngraph/core/src/op/one_hot.cpp +++ b/ngraph/core/src/op/one_hot.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v1::OneHot::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::OneHot, "OneHot", 1); op::v1::OneHot::OneHot(const Output& indices, const Output& depth, diff --git a/ngraph/core/src/op/pad.cpp b/ngraph/core/src/op/pad.cpp index cc1f8ecb206..e535d888253 100644 --- a/ngraph/core/src/op/pad.cpp +++ b/ngraph/core/src/op/pad.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v1::Pad::type_info; +NGRAPH_RTTI_DEFINITION(op::v1::Pad, "Pad", 1); op::v1::Pad::Pad(const Output& arg, const Output& pads_begin, diff --git a/ngraph/core/src/op/prior_box.cpp b/ngraph/core/src/op/prior_box.cpp index 52f12330a65..3af4618296f 100644 --- a/ngraph/core/src/op/prior_box.cpp +++ b/ngraph/core/src/op/prior_box.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::PriorBox::type_info; +NGRAPH_RTTI_DEFINITION(op::PriorBox, "PriorBox", 0); op::PriorBox::PriorBox(const Output& layer_shape, const Output& image_shape, diff --git a/ngraph/core/src/op/prior_box_clustered.cpp b/ngraph/core/src/op/prior_box_clustered.cpp index 1b146005a75..e906921e815 100644 --- a/ngraph/core/src/op/prior_box_clustered.cpp +++ b/ngraph/core/src/op/prior_box_clustered.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::PriorBoxClustered::type_info; +NGRAPH_RTTI_DEFINITION(op::PriorBoxClustered, "PriorBoxClustered", 0); op::PriorBoxClustered::PriorBoxClustered(const Output& layer_shape, const Output& image_shape, diff --git a/ngraph/core/src/op/psroi_pooling.cpp b/ngraph/core/src/op/psroi_pooling.cpp index 56db7a90ee2..15e2d7a766f 100644 --- a/ngraph/core/src/op/psroi_pooling.cpp +++ b/ngraph/core/src/op/psroi_pooling.cpp @@ -9,7 +9,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::PSROIPooling::type_info; +NGRAPH_RTTI_DEFINITION(op::PSROIPooling, "PSROIPooling", 0); op::PSROIPooling::PSROIPooling(const Output& input, const Output& coords, diff --git a/ngraph/core/src/op/range.cpp b/ngraph/core/src/op/range.cpp index 5990ef3dcbd..6d415441eb0 100644 --- a/ngraph/core/src/op/range.cpp +++ b/ngraph/core/src/op/range.cpp @@ -322,7 +322,7 @@ bool op::v4::Range::has_evaluate() const return false; } -constexpr NodeTypeInfo op::v0::Range::type_info; +NGRAPH_RTTI_DEFINITION(op::v0::Range, "Range", 0); op::v0::Range::Range(const Output& start, const Output& stop, const Output& step) : Op({start, stop, step}) diff --git a/ngraph/core/src/op/region_yolo.cpp b/ngraph/core/src/op/region_yolo.cpp index 315aa461de0..167996e6d33 100644 --- a/ngraph/core/src/op/region_yolo.cpp +++ b/ngraph/core/src/op/region_yolo.cpp @@ -9,7 +9,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::RegionYolo::type_info; +NGRAPH_RTTI_DEFINITION(op::RegionYolo, "RegionYolo", 0); op::RegionYolo::RegionYolo(const Output& input, const size_t coords, diff --git a/ngraph/core/src/op/reorg_yolo.cpp b/ngraph/core/src/op/reorg_yolo.cpp index 67cbac78d8c..8681e1bb004 100644 --- a/ngraph/core/src/op/reorg_yolo.cpp +++ b/ngraph/core/src/op/reorg_yolo.cpp @@ -9,7 +9,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::ReorgYolo::type_info; +NGRAPH_RTTI_DEFINITION(op::ReorgYolo, "ReorgYolo", 0); op::ReorgYolo::ReorgYolo(const Output& input, const Strides& strides) : Op({input}) diff --git a/ngraph/core/src/op/reverse_sequence.cpp b/ngraph/core/src/op/reverse_sequence.cpp index bac3ac3b4bd..77b105187a7 100644 --- a/ngraph/core/src/op/reverse_sequence.cpp +++ b/ngraph/core/src/op/reverse_sequence.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::ReverseSequence::type_info; +NGRAPH_RTTI_DEFINITION(op::ReverseSequence, "ReverseSequence", 0); op::ReverseSequence::ReverseSequence(const Output& arg, const Output& seq_indices, diff --git a/ngraph/core/src/op/rnn_cell.cpp b/ngraph/core/src/op/rnn_cell.cpp index 4b98f22f217..f1f5cff4468 100644 --- a/ngraph/core/src/op/rnn_cell.cpp +++ b/ngraph/core/src/op/rnn_cell.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v0::RNNCell::type_info; +NGRAPH_RTTI_DEFINITION(op::v0::RNNCell, "RNNCell", 0, util::RNNCellBase); op::v0::RNNCell::RNNCell() { diff --git a/ngraph/core/src/op/space_to_depth.cpp b/ngraph/core/src/op/space_to_depth.cpp index 8847c6efbce..a31af19558f 100644 --- a/ngraph/core/src/op/space_to_depth.cpp +++ b/ngraph/core/src/op/space_to_depth.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::SpaceToDepth::type_info; +NGRAPH_RTTI_DEFINITION(op::SpaceToDepth, "SpaceToDepth", 0); op::SpaceToDepth::SpaceToDepth(const Output& data, const SpaceToDepthMode& mode, diff --git a/ngraph/core/src/op/tensor_iterator.cpp b/ngraph/core/src/op/tensor_iterator.cpp index 35162ef3ceb..6dffdaa77fe 100644 --- a/ngraph/core/src/op/tensor_iterator.cpp +++ b/ngraph/core/src/op/tensor_iterator.cpp @@ -11,7 +11,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v0::TensorIterator::type_info; +NGRAPH_RTTI_DEFINITION(op::v0::TensorIterator, "TensorIterator", 0, op::util::SubGraphOp); op::v0::TensorIterator::TensorIterator(const OutputVector& values) : op::util::SubGraphOp(values) diff --git a/ngraph/core/src/op/tile.cpp b/ngraph/core/src/op/tile.cpp index 87b56353b9c..e85b25c7771 100644 --- a/ngraph/core/src/op/tile.cpp +++ b/ngraph/core/src/op/tile.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v0::Tile::type_info; +NGRAPH_RTTI_DEFINITION(op::v0::Tile, "Tile", 0); op::v0::Tile::Tile(const Output& data, const Output& repeats) : Op({data, repeats}) diff --git a/ngraph/core/src/op/util/broadcast_base.cpp b/ngraph/core/src/op/util/broadcast_base.cpp index c6ecdd69f8f..5fe86f81f98 100644 --- a/ngraph/core/src/op/util/broadcast_base.cpp +++ b/ngraph/core/src/op/util/broadcast_base.cpp @@ -18,6 +18,8 @@ using namespace std; using namespace ngraph; +NGRAPH_RTTI_DEFINITION(op::util::BroadcastBase, "BroadcastBase", 0); + op::util::BroadcastBase::BroadcastBase(const Output& arg, const Output& target_shape, const Output& axes_mapping, diff --git a/ngraph/core/src/op/util/fused_op.cpp b/ngraph/core/src/op/util/fused_op.cpp index 5c2bf4f1a12..8db541c6afb 100644 --- a/ngraph/core/src/op/util/fused_op.cpp +++ b/ngraph/core/src/op/util/fused_op.cpp @@ -11,6 +11,8 @@ using namespace ngraph; NGRAPH_SUPPRESS_DEPRECATED_START +NGRAPH_RTTI_DEFINITION(op::util::FusedOp, "FusedOp", 0); + op::util::FusedOp::FusedOp() : Op() { diff --git a/ngraph/core/src/op/util/rnn_cell_base.cpp b/ngraph/core/src/op/util/rnn_cell_base.cpp index e087cacdfb2..0169b86d712 100644 --- a/ngraph/core/src/op/util/rnn_cell_base.cpp +++ b/ngraph/core/src/op/util/rnn_cell_base.cpp @@ -19,6 +19,8 @@ using namespace std; using namespace ngraph; +NGRAPH_RTTI_DEFINITION(op::util::RNNCellBase, "RNNCellBase", 0); + std::shared_ptr ngraph::op::util::convert_lstm_node_format(const Output& node, LSTMWeightsFormat from_format, LSTMWeightsFormat to_format,