diff --git a/ngraph/core/include/ngraph/op/deformable_convolution.hpp b/ngraph/core/include/ngraph/op/deformable_convolution.hpp index 2d95b83eafddc3..88141dcd39c77c 100644 --- a/ngraph/core/include/ngraph/op/deformable_convolution.hpp +++ b/ngraph/core/include/ngraph/op/deformable_convolution.hpp @@ -8,168 +8,16 @@ #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "ngraph/op/util/deformable_convolution_base.hpp" +#include "openvino/op/deformable_convolution.hpp" namespace ngraph { namespace op { namespace v1 { -/// \brief DeformableConvolution operation. -class NGRAPH_API DeformableConvolution : public op::util::DeformableConvolutionBase { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Constructs a conversion operation. - DeformableConvolution() = default; - /// \brief Constructs a conversion operation. - /// - /// \param arg Node that produces the input tensor. - /// \param offsets Node producing the deformable values tensor. - /// \param filters Node producing the filters(kernels) tensor with OIZYX - /// layout. - /// \param strides Convolution strides. - /// \param pads_begin Amount of padding to be added to the beginning along - /// each axis. For example in case of a 2D input the value - /// of (1, 2) means that 1 element will be added to the - /// top and 2 elements to the left. - /// \param pads_end Amount of padding to be added to the end along each - /// axis. - /// \param dilations The distance in width and height between the weights - /// in the filters tensor. - /// \param auto_pad Specifies how the automatic calculation of padding - /// should be done. - /// \param group The number of groups which both output and input - /// should be split into. - /// \param deformable_group The number of groups which deformable values and - /// output should be split into along the channel axis. - DeformableConvolution(const Output& arg, - const Output& offsets, - const Output& filters, - const Strides& strides, - const CoordinateDiff& pads_begin, - const CoordinateDiff& pads_end, - const Strides& dilations, - const PadType& auto_pad = PadType::EXPLICIT, - const int64_t group = 1, - const int64_t deformable_group = 1); - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; -}; +using ov::op::v1::DeformableConvolution; } // namespace v1 namespace v8 { -class NGRAPH_API DeformableConvolution : public op::util::DeformableConvolutionBase { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Constructs a conversion operation. - DeformableConvolution() = default; - /// \brief Constructs a conversion operation. - /// - /// \param arg Node that produces the input tensor. - /// \param offsets Node producing the deformable values tensor. - /// \param filters Node producing the filters(kernels) tensor with OIZYX - /// layout. - /// \param strides Convolution strides. - /// \param pads_begin Amount of padding to be added to the beginning along - /// each axis. For example in case of a 2D input the value - /// of (1, 2) means that 1 element will be added to the - /// top and 2 elements to the left. - /// \param pads_end Amount of padding to be added to the end along each - /// axis. - /// \param dilations The distance in width and height between the weights - /// in the filters tensor. - /// \param auto_pad Specifies how the automatic calculation of padding - /// should be done. - /// \param group The number of groups which both output and input - /// should be split into. - /// \param deformable_group The number of groups which deformable values and - /// output should be split into along the channel axis. - /// \param bilinear_interpolation_pad - /// The flag that determines the mode of bilinear - /// interpolation execution. - /// If the flag is `true` and the sampling location is - /// within one pixel outside of the feature map boundary, - /// then bilinear interpolation is performed on the zero - /// padded feature map. If the flag is `false` and the - /// sampling location is within one pixel outside of the - /// feature map boundary, then the sampling location - /// shifts to the inner boundary of the feature map.` - DeformableConvolution(const Output& arg, - const Output& offsets, - const Output& filters, - const Strides& strides, - const CoordinateDiff& pads_begin, - const CoordinateDiff& pads_end, - const Strides& dilations, - const PadType& auto_pad = PadType::EXPLICIT, - const int64_t group = 1, - const int64_t deformable_group = 1, - const bool bilinear_interpolation_pad = false); - - /// \brief Constructs a conversion operation. - /// - /// \param arg Node that produces the input tensor. - /// \param offsets Node producing the deformable values tensor. - /// \param filters Node producing the filters(kernels) tensor with OIZYX - /// layout. - /// \param mask Node producing the mask(mask) tensor. - /// \param strides Convolution strides. - /// \param pads_begin Amount of padding to be added to the beginning along - /// each axis. For example in case of a 2D input the value - /// of (1, 2) means that 1 element will be added to the - /// top and 2 elements to the left. - /// \param pads_end Amount of padding to be added to the end along each - /// axis. - /// \param dilations The distance in width and height between the weights - /// in the filters tensor. - /// \param auto_pad Specifies how the automatic calculation of padding - /// should be done. - /// \param group The number of groups which both output and input - /// should be split into. - /// \param deformable_group The number of groups which deformable values and - /// output should be split into along the channel axis. - /// \param bilinear_interpolation_pad - /// The flag that determines the mode of bilinear - /// interpolation execution. - /// If the flag is `true` and the sampling location is - /// within one pixel outside of the feature map boundary, - /// then bilinear interpolation is performed on the zero - /// padded feature map. If the flag is `false` and the - /// sampling location is within one pixel outside of the - /// feature map boundary, then the sampling location - /// shifts to the inner boundary of the feature map. - DeformableConvolution(const Output& arg, - const Output& offsets, - const Output& filters, - const Output& mask, - const Strides& strides, - const CoordinateDiff& pads_begin, - const CoordinateDiff& pads_end, - const Strides& dilations, - const PadType& auto_pad = PadType::EXPLICIT, - const int64_t group = 1, - const int64_t deformable_group = 1, - const bool bilinear_interpolation_pad = false); - bool visit_attributes(AttributeVisitor& visitor) override; - - void validate_and_infer_types() override; - - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - - bool has_evaluate() const override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - bool get_bilinear_interpolation_pad() const { - return m_bilinear_interpolation_pad; - } - - void set_bilinear_interpolation_pad(const bool bilinear_interpolation_pad) { - m_bilinear_interpolation_pad = bilinear_interpolation_pad; - } - -private: - bool m_bilinear_interpolation_pad; -}; +using ov::op::v8::DeformableConvolution; } // namespace v8 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp b/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp index 362d325ef33bdc..6e47d387a987da 100644 --- a/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp +++ b/ngraph/core/include/ngraph/op/deformable_psroi_pooling.hpp @@ -5,103 +5,12 @@ #pragma once #include "ngraph/op/op.hpp" +#include "openvino/op/deformable_psroi_pooling.hpp" namespace ngraph { namespace op { namespace v1 { -class NGRAPH_API DeformablePSROIPooling : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - DeformablePSROIPooling() = default; - /// \brief Constructs a DeformablePSROIPooling operation - /// - /// \param input Input tensor with position sensitive score maps - /// \param coords Input tensor with list of five element tuples - /// describing ROI coordinates - /// \param offsets Input tensor with transformation values - /// \param output_dim Pooled output channel number - /// \param group_size Number of horizontal bins per row to divide ROI area, - /// it defines output width and height - /// \param spatial_scale Multiplicative spatial scale factor to translate ROI - /// coordinates from their input scale to the scale used when - /// pooling - /// \param mode Specifies mode for pooling. - /// \param spatial_bins_x Specifies numbers of bins to divide ROI single - /// bin over width - /// \param spatial_bins_y Specifies numbers of bins to divide ROI single - /// bin over height - /// \param no_trans The flag that specifies whenever third input exists - /// and contains transformation (offset) values - /// \param trans_std The value that all transformation (offset) values are - /// multiplied with - /// \param part_size The number of parts the output tensor spatial dimensions - /// are divided into. Basically it is the height - /// and width of the third input - DeformablePSROIPooling(const Output& input, - const Output& coords, - const Output& offsets, - const int64_t output_dim, - const float spatial_scale, - const int64_t group_size = 1, - const std::string mode = "bilinear_deformable", - int64_t spatial_bins_x = 1, - int64_t spatial_bins_y = 1, - float trans_std = 1, - int64_t part_size = 1); - - DeformablePSROIPooling(const Output& input, - const Output& coords, - const int64_t output_dim, - const float spatial_scale, - const int64_t group_size = 1, - const std::string mode = "bilinear_deformable", - int64_t spatial_bins_x = 1, - int64_t spatial_bins_y = 1, - float trans_std = 1, - int64_t part_size = 1); - - bool visit_attributes(AttributeVisitor& visitor) override; - - void validate_and_infer_types() override; - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - int64_t get_output_dim() const { - return m_output_dim; - } - int64_t get_group_size() const { - return m_group_size; - } - float get_spatial_scale() const { - return m_spatial_scale; - } - const std::string& get_mode() const { - return m_mode; - } - int64_t get_spatial_bins_x() const { - return m_spatial_bins_x; - } - int64_t get_spatial_bins_y() const { - return m_spatial_bins_y; - } - float get_trans_std() const { - return m_trans_std; - } - int64_t get_part_size() const { - return m_part_size; - } - -private: - int64_t m_output_dim; - float m_spatial_scale; - int64_t m_group_size = 1; - std::string m_mode = "bilinear_deformable"; - int64_t m_spatial_bins_x = 1; - int64_t m_spatial_bins_y = 1; - float m_trans_std = 1.f; - int64_t m_part_size = 1; -}; +using ov::op::v1::DeformablePSROIPooling; } // namespace v1 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/depth_to_space.hpp b/ngraph/core/include/ngraph/op/depth_to_space.hpp index 0b57d0476db3e9..8fd67c9eda5855 100644 --- a/ngraph/core/include/ngraph/op/depth_to_space.hpp +++ b/ngraph/core/include/ngraph/op/depth_to_space.hpp @@ -6,76 +6,13 @@ #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/depth_to_space.hpp" namespace ngraph { namespace op { namespace v0 { -/// \brief DepthToSpace permutes data from the depth dimension of the input blob into -/// spatial dimensions. -/// -/// \note Values from the depth dimension (assuming NCHW layout) are moved in -/// spatial blocks to the height and width dimensions. -/// -/// Output node produces a tensor with shape: -/// [N, C/(blocksize * blocksize), H * blocksize, W * blocksize] -class NGRAPH_API DepthToSpace : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - enum class DepthToSpaceMode { - // The input depth is divided to [block_size, ..., block_size, new_depth] - BLOCKS_FIRST, - // The input depth is divided to [new_depth, block_size, ..., block_size] - DEPTH_FIRST - }; - - DepthToSpace() = default; - /// \brief Constructs a DepthToSpace operation. - /// - /// \param data Node producing the input tensor - /// \param mode Specifies how the input depth dimension is split to block - /// coordinates - /// \param block_size The size of the block of values to be moved - DepthToSpace(const Output& data, const DepthToSpaceMode& mode, std::size_t block_size = 1); - - DepthToSpace(const Output& data, const std::string& mode, std::size_t block_size = 1); - bool visit_attributes(AttributeVisitor& visitor) override; - - std::size_t get_block_size() const { - return m_blocksize; - } - DepthToSpaceMode get_mode() const { - return m_mode; - } - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - void validate_and_infer_types() override; - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; - -protected: - std::size_t m_blocksize; - DepthToSpaceMode m_mode; -}; +using ov::op::v0::DepthToSpace; } // namespace v0 using v0::DepthToSpace; } // namespace op - -NGRAPH_API -std::ostream& operator<<(std::ostream& s, const op::v0::DepthToSpace::DepthToSpaceMode& type); } // namespace ngraph -namespace ov { - -template <> -class NGRAPH_API AttributeAdapter - : public EnumAttributeAdapterBase { -public: - AttributeAdapter(ngraph::op::v0::DepthToSpace::DepthToSpaceMode& value) - : EnumAttributeAdapterBase(value) {} - - static constexpr DiscreteTypeInfo type_info{"AttributeAdapter", 0}; - const DiscreteTypeInfo& get_type_info() const override { - return type_info; - } -}; - -} // namespace ov diff --git a/ngraph/core/include/ngraph/op/detection_output.hpp b/ngraph/core/include/ngraph/op/detection_output.hpp index b00a41096c7fab..5400d5b22bfbf3 100644 --- a/ngraph/core/include/ngraph/op/detection_output.hpp +++ b/ngraph/core/include/ngraph/op/detection_output.hpp @@ -5,74 +5,14 @@ #pragma once #include "ngraph/op/op.hpp" +#include "openvino/op/detection_output.hpp" namespace ngraph { namespace op { -struct DetectionOutputAttrs { - int num_classes; - int background_label_id = 0; - int top_k = -1; - bool variance_encoded_in_target = false; - std::vector keep_top_k; - std::string code_type = std::string{"caffe.PriorBoxParameter.CORNER"}; - bool share_location = true; - float nms_threshold; - float confidence_threshold = 0; - bool clip_after_nms = false; - bool clip_before_nms = false; - bool decrease_label_id = false; - bool normalized = false; - size_t input_height = 1; - size_t input_width = 1; - float objectness_score = 0; -}; +using DetectionOutputAttrs = ov::op::v0::DetectionOutput::Attributes; namespace v0 { -/// \brief Layer which performs non-max suppression to -/// generate detection output using location and confidence predictions -class NGRAPH_API DetectionOutput : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - DetectionOutput() = default; - /// \brief Constructs a DetectionOutput operation - /// - /// \param box_logits Box logits - /// \param class_preds Class predictions - /// \param proposals Proposals - /// \param aux_class_preds Auxilary class predictions - /// \param aux_box_preds Auxilary box predictions - /// \param attrs Detection Output attributes - DetectionOutput(const Output& box_logits, - const Output& class_preds, - const Output& proposals, - const Output& aux_class_preds, - const Output& aux_box_preds, - const DetectionOutputAttrs& attrs); - - /// \brief Constructs a DetectionOutput operation - /// - /// \param box_logits Box logits - /// \param class_preds Class predictions - /// \param proposals Proposals - /// \param attrs Detection Output attributes - DetectionOutput(const Output& box_logits, - const Output& class_preds, - const Output& proposals, - const DetectionOutputAttrs& attrs); - - void validate_and_infer_types() override; - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - const DetectionOutputAttrs& get_attrs() const { - return m_attrs; - } - bool visit_attributes(AttributeVisitor& visitor) override; - -private: - DetectionOutputAttrs m_attrs; -}; +using ov::op::v0::DetectionOutput; } // namespace v0 using v0::DetectionOutput; } // namespace op diff --git a/ngraph/core/include/ngraph/op/dft.hpp b/ngraph/core/include/ngraph/op/dft.hpp index 3065d128df7d06..abd217511bc8fc 100644 --- a/ngraph/core/include/ngraph/op/dft.hpp +++ b/ngraph/core/include/ngraph/op/dft.hpp @@ -23,33 +23,12 @@ #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" #include "ngraph/op/util/fft_base.hpp" +#include "openvino/op/dft.hpp" namespace ngraph { namespace op { namespace v7 { -/// \brief An operation DFT that computes the discrete Fourier transformation. -class NGRAPH_API DFT : public util::FFTBase { -public: - NGRAPH_RTTI_DECLARATION; - DFT() = default; - - /// \brief Constructs a DFT operation. DFT is performed for full size axes. - /// - /// \param data Input data - /// \param axes Axes to perform DFT - DFT(const Output& data, const Output& axes); - - /// \brief Constructs a DFT operation. - /// - /// \param data Input data - /// \param axes Axes to perform DFT - /// \param signal_size Signal sizes for 'axes' - DFT(const Output& data, const Output& axes, const Output& signal_size); - - bool visit_attributes(AttributeVisitor& visitor) override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; -}; +using ov::op::v7::DFT; } // namespace v7 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/divide.hpp b/ngraph/core/include/ngraph/op/divide.hpp index 9f9364e81814bb..9b74d17e1493a4 100644 --- a/ngraph/core/include/ngraph/op/divide.hpp +++ b/ngraph/core/include/ngraph/op/divide.hpp @@ -5,51 +5,12 @@ #pragma once #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" +#include "openvino/op/divide.hpp" namespace ngraph { namespace op { namespace v1 { -/// \brief Elementwise division operation. -class NGRAPH_API Divide : public util::BinaryElementwiseArithmetic { -public: - NGRAPH_RTTI_DECLARATION; - /// \brief Constructs a division operation. - Divide() : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY) {} - - /// \brief Constructs a division operation. - /// - /// \param arg0 Node that produces the first input tensor. - /// \param arg1 Node that produces the second input tensor. - /// \param pythondiv Use Python style rounding for integral type - /// \param auto_broadcast Auto broadcast specification - Divide(const Output& arg0, - const Output& arg1, - bool pythondiv, - const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); - - /// \brief Constructs a division operation. - /// - /// \param arg0 Node that produces the first input tensor. - /// \param arg1 Node that produces the second input tensor. - /// \param auto_broadcast Auto broadcast specification - Divide(const Output& arg0, - const Output& arg1, - const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); - bool visit_attributes(AttributeVisitor& visitor) override; - bool is_pythondiv() const { - return m_pythondiv; - } - void set_is_pythondiv(bool pythondiv) { - m_pythondiv = pythondiv; - } - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; - -protected: - bool m_pythondiv{true}; -}; +using ov::op::v1::Divide; } // namespace v1 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/einsum.hpp b/ngraph/core/include/ngraph/op/einsum.hpp index a23c2c0f7c507c..71de175f8ddf56 100644 --- a/ngraph/core/include/ngraph/op/einsum.hpp +++ b/ngraph/core/include/ngraph/op/einsum.hpp @@ -6,67 +6,12 @@ #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" +#include "openvino/op/einsum.hpp" namespace ngraph { namespace op { namespace v7 { -/// \brief Einsum operation. -class NGRAPH_API Einsum : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - Einsum() = default; - - /// - /// \brief Constructs Einsum operation. - /// - /// \param inputs Input nodes on which Einsum operation performs - /// contraction - /// - /// \param equation Einstein summation convention - /// - Einsum(const OutputVector& inputs, const std::string& equation); - - void validate_and_infer_types() override; - - bool visit_attributes(AttributeVisitor& visitor) override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - /// \brief Get an equation of Einsum operation - /// - /// \return Einsum equation - /// - std::string get_equation() const { - return m_equation; - } - - /// \brief Check correctness of equation format and extract input subscripts - /// and output subscript - /// - /// \param equation Equation to be parsed and checked - /// - /// \param input_subscripts A vector of extracted input subscripts - /// - /// \param output_subscript An output subscript - /// - static void parse_equation(const std::string& equation, - std::vector& input_subscripts, - std::string& output_subscript); - - /// \brief Extract labels (from subscript) that can be alphabetic letters or - /// ellipsis - /// - /// \param subscript Subscript - /// - /// \return A vector of extracted labels from the input subscript in the order - /// of appearence - /// - static std::vector extract_labels(const std::string& subscript); - -private: - std::string m_equation; -}; +using ov::op::v7::Einsum; } // namespace v7 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/elu.hpp b/ngraph/core/include/ngraph/op/elu.hpp index 173cb9b02a6a1e..0e1356c130f87c 100644 --- a/ngraph/core/include/ngraph/op/elu.hpp +++ b/ngraph/core/include/ngraph/op/elu.hpp @@ -6,37 +6,12 @@ #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" +#include "openvino/op/elu.hpp" namespace ngraph { namespace op { namespace v0 { -/// \brief Exponential Linear Unit -/// x < 0 => f(x) = alpha * (exp(x) - 1.) -/// x >= 0 => f(x) = x -/// -class NGRAPH_API Elu : public ngraph::op::Op { -public: - NGRAPH_RTTI_DECLARATION; - - Elu() = default; - /// \brief Constructs an Elu operation. - /// - /// \param data Input tensor - /// \param alpha Multiplier for negative values - Elu(const Output& data, const double alpha); - - bool visit_attributes(AttributeVisitor& visitor) override; - void validate_and_infer_types() override; - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - double get_alpha() const { - return m_alpha; - } - -private: - double m_alpha; -}; +using ov::op::v0::Elu; } // namespace v0 using v0::Elu; } // namespace op diff --git a/ngraph/core/include/ngraph/op/embedding_segments_sum.hpp b/ngraph/core/include/ngraph/op/embedding_segments_sum.hpp index ebca3b5164b7a4..0d264a28cf5b7d 100644 --- a/ngraph/core/include/ngraph/op/embedding_segments_sum.hpp +++ b/ngraph/core/include/ngraph/op/embedding_segments_sum.hpp @@ -6,75 +6,12 @@ #include "ngraph/axis_set.hpp" #include "ngraph/op/util/index_reduction.hpp" +#include "openvino/op/embedding_segments_sum.hpp" namespace ngraph { namespace op { namespace v3 { -/// \brief Returns embeddings for given indices -class NGRAPH_API EmbeddingSegmentsSum : public Op { -public: - static constexpr NodeTypeInfo type_info{"EmbeddingSegmentsSum", 3}; - const NodeTypeInfo& get_type_info() const override { - return type_info; - } - /// \brief Constructs a EmbeddingSegmentsSum operation. - EmbeddingSegmentsSum() = default; - /// \brief Constructs a EmbeddingSegmentsSum operation. - /// - /// EmbeddingSegmentsSum constructs an output tensor by replacing every index in a - /// given - /// input tensor with a row (from the weights matrix) at that index - /// - /// \param 'emb_table' tensor containing the embedding lookup table of the module of - /// shape [num_emb, emb_dim1, emb_dim2, ...] and of type T - /// \param 'indices' tensor of shape [num_indices] and of type T_IND. Required - /// \param `segment_ids` tensor of shape `[num_indices]` and of type *T_IND* with - /// indices - /// into the output Tensor. Values should be sorted and can be repeated. Required. - /// \param `num_segments` scalar of type *T_IND* indicating the number of segments. - /// Required. - /// \param 'default_index' scalar of type T_IND containing default index in - /// embedding - /// table to fill empty "bags". If not provided empty "bags" - /// are filled with zeros. Optional. - /// \param 'per_sample_weights' tensor of the same shape as indices and of type T. - /// Each value in this tensor are multiplied with each - /// value pooled from embedding table for each index. Optional. - - EmbeddingSegmentsSum(const Output& emb_table, - const Output& indices, - const Output& segment_ids, - const Output& num_segments, - const Output& default_index, - const Output& per_sample_weights); - - EmbeddingSegmentsSum(const Output& emb_table, - const Output& indices, - const Output& segment_ids, - const Output& num_segments, - const Output& default_index); - - EmbeddingSegmentsSum(const Output& emb_table, - const Output& indices, - const Output& segment_ids, - const Output& num_segments); - - void validate_and_infer_types() override; - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - bool visit_attributes(AttributeVisitor&) override { - return true; - } - -private: - static constexpr int EMB_TABLE = 0; - static constexpr int INDICES = 1; - static constexpr int SEGMENT_IDS = 2; - static constexpr int NUM_SEGMENTS = 3; - static constexpr int DEFAULT_INDEX = 4; - static constexpr int PER_SAMPLE_WEIGHTS = 5; -}; +using ov::op::v3::EmbeddingSegmentsSum; } // namespace v3 using v3::EmbeddingSegmentsSum; } // namespace op diff --git a/ngraph/core/include/ngraph/op/embeddingbag_offsets_sum.hpp b/ngraph/core/include/ngraph/op/embeddingbag_offsets_sum.hpp index f47def5fee5e85..6fc907a272df79 100644 --- a/ngraph/core/include/ngraph/op/embeddingbag_offsets_sum.hpp +++ b/ngraph/core/include/ngraph/op/embeddingbag_offsets_sum.hpp @@ -7,52 +7,12 @@ #include "ngraph/axis_set.hpp" #include "ngraph/op/util/embeddingbag_offsets_base.hpp" #include "ngraph/op/util/index_reduction.hpp" +#include "openvino/op/embeddingbag_offsets_sum.hpp" namespace ngraph { namespace op { namespace v3 { -/// \brief Returns embeddings for given indices -class NGRAPH_API EmbeddingBagOffsetsSum : public util::EmbeddingBagOffsetsBase { -public: - static constexpr NodeTypeInfo type_info{"EmbeddingBagOffsetsSum", 3}; - const NodeTypeInfo& get_type_info() const override { - return type_info; - } - /// \brief Constructs a EmbeddingBagOffsetsSum operation. - EmbeddingBagOffsetsSum() = default; - /// \brief Constructs a EmbeddingBagOffsetsSum operation. - /// - /// EmbeddingBagOffsetsSum constructs an output tensor by replacing every index in a - /// given - /// input tensor with a row (from the weights matrix) at that index - /// - /// \param emb_table tensor containing the embedding lookup table of the module of - /// shape [num_emb, emb_dim1, emb_dim2, ...] and of type T - /// \param tensor of shape [num_indices] and of type T_IND. Required - /// \param offsets tensor of shape [batch] and of type T_IND containing the starting - /// index positions of each "bag" in indices. Required. - /// \param default_index scalar of type T_IND containing default index in embedding - /// table to fill empty "bags". If not provided empty "bags" - /// are filled with zeros. Optional. - /// \param per_sample_weigths tensor of the same shape as indices and of type T. - /// Each value in this tensor are multiplied with each - /// value pooled from embedding table for each index. Optional. - - EmbeddingBagOffsetsSum(const Output& emb_table, - const Output& indices, - const Output& offsets, - const Output& default_index, - const Output& per_sample_weights); - - EmbeddingBagOffsetsSum(const Output& emb_table, - const Output& indices, - const Output& offsets, - const Output& default_index); - - EmbeddingBagOffsetsSum(const Output& emb_table, const Output& indices, const Output& offsets); - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; -}; +using ov::op::v3::EmbeddingBagOffsetsSum; } // namespace v3 using v3::EmbeddingBagOffsetsSum; } // namespace op diff --git a/ngraph/core/include/ngraph/op/embeddingbag_packedsum.hpp b/ngraph/core/include/ngraph/op/embeddingbag_packedsum.hpp index 159f100a610a6d..8952ce1be9db2f 100644 --- a/ngraph/core/include/ngraph/op/embeddingbag_packedsum.hpp +++ b/ngraph/core/include/ngraph/op/embeddingbag_packedsum.hpp @@ -7,41 +7,12 @@ #include "ngraph/axis_set.hpp" #include "ngraph/op/util/embeddingbag_packed_base.hpp" #include "ngraph/op/util/index_reduction.hpp" +#include "openvino/op/embeddingbag_packedsum.hpp" namespace ngraph { namespace op { namespace v3 { -/// \brief Returns embeddings for given indices -class NGRAPH_API EmbeddingBagPackedSum : public util::EmbeddingBagPackedBase { -public: - static constexpr NodeTypeInfo type_info{"EmbeddingBagPackedSum", 3}; - const NodeTypeInfo& get_type_info() const override { - return type_info; - } - /// \brief Constructs a EmbeddingBagPackedSum operation. - EmbeddingBagPackedSum() = default; - /// \brief Constructs a EmbeddingBagPackedSum operation. - /// - /// EmbeddingBagPackedSum constructs an output tensor by replacing every index in a - /// given - /// input tensor with a row (from the weights matrix) at that index - /// - /// \param emb_table Tensor containing the embedding lookup table of the module of - /// shape [num_emb, emb_dim1, emb_dim2, ...] and of type T - /// \param indices Tensor of shape `[batch, indices_per_bag]` and of type *T_IND*. - /// Required. - /// \param per_sample_weigths tensor of the same shape as indices and of type T. - /// Each value in this tensor are multiplied with each - /// value pooled from embedding table for each index. Optional. - - EmbeddingBagPackedSum(const Output& emb_table, - const Output& indices, - const Output& per_sample_weights); - - EmbeddingBagPackedSum(const Output& emb_table, const Output& indices); - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; -}; +using ov::op::v3::EmbeddingBagPackedSum; } // namespace v3 using v3::EmbeddingBagPackedSum; } // namespace op diff --git a/ngraph/core/include/ngraph/op/equal.hpp b/ngraph/core/include/ngraph/op/equal.hpp index 81766834f0b302..6751bd0b8eb12d 100644 --- a/ngraph/core/include/ngraph/op/equal.hpp +++ b/ngraph/core/include/ngraph/op/equal.hpp @@ -5,47 +5,12 @@ #pragma once #include "ngraph/op/util/binary_elementwise_comparison.hpp" +#include "openvino/op/equal.hpp" namespace ngraph { namespace op { namespace v1 { -// clang-format off - /// \brief Elementwise is-equal operation. - /// - /// ## Inputs - /// - /// | | Type | Description | - /// | ------ | --------------------------------- | ------------------------------------------------------ | - /// | `arg0` | \f$E[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and element type. | - /// | `arg1` | \f$E[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of the same shape and element type as `arg0`. | - /// | `autob`| AutoBroadcastSpec | Auto broadcast specification. | - /// - /// ## Output - /// - /// | Type | Description | - /// | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | - /// | \f$\texttt{bool}[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = 1\text{ if }\texttt{arg0}[i_1,\dots,i_n] = \texttt{arg1}[i_1,\dots,i_n]\text{, else } 0\f$ | -// clang-format on -class NGRAPH_API Equal : public util::BinaryElementwiseComparison { -public: - NGRAPH_RTTI_DECLARATION; - /// \brief Constructs an equal operation. - Equal() : util::BinaryElementwiseComparison(AutoBroadcastSpec::NUMPY) {} - /// \brief Constructs an equal operation. - /// - /// \param arg0 Node that produces the first input tensor. - /// \param arg1 Node that produces the second input tensor. - /// \param auto_broadcast Auto broadcast specification - Equal(const Output& arg0, - const Output& arg1, - const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); - - bool visit_attributes(AttributeVisitor& visitor) override; - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; -}; +using ov::op::v1::Equal; } // namespace v1 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/erf.hpp b/ngraph/core/include/ngraph/op/erf.hpp index 3bb5392bbfee1a..22a4a7246f5e45 100644 --- a/ngraph/core/include/ngraph/op/erf.hpp +++ b/ngraph/core/include/ngraph/op/erf.hpp @@ -5,26 +5,12 @@ #pragma once #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" +#include "openvino/op/erf.hpp" namespace ngraph { namespace op { namespace v0 { -/// \brief Elementwise erf operation. -class NGRAPH_API Erf : public util::UnaryElementwiseArithmetic { -public: - NGRAPH_RTTI_DECLARATION; - /// \brief Constructs a floor operation. - Erf() = default; - /// \brief Constructs a floor operation. - /// - /// \param arg Node that produces the input tensor. - Erf(const Output& arg); - - bool visit_attributes(AttributeVisitor& visitor) override; - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; -}; +using ov::op::v0::Erf; } // namespace v0 using v0::Erf; } // namespace op diff --git a/ngraph/core/include/ngraph/op/exp.hpp b/ngraph/core/include/ngraph/op/exp.hpp index f8170c66249eff..8172778087e435 100644 --- a/ngraph/core/include/ngraph/op/exp.hpp +++ b/ngraph/core/include/ngraph/op/exp.hpp @@ -5,28 +5,12 @@ #pragma once #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" +#include "openvino/op/exp.hpp" namespace ngraph { namespace op { namespace v0 { -/// \brief Elementwise natural exponential (exp) operation. -class NGRAPH_API Exp : public util::UnaryElementwiseArithmetic { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Constructs an exponential operation. - Exp() = default; - /// \brief Constructs an exponential operation. - /// - /// \param arg Node that produces the input tensor. - Exp(const Output& arg); - - bool visit_attributes(AttributeVisitor& visitor) override; - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; -}; +using ov::op::v0::Exp; } // namespace v0 using v0::Exp; } // namespace op diff --git a/ngraph/core/include/ngraph/op/experimental_detectron_detection_output.hpp b/ngraph/core/include/ngraph/op/experimental_detectron_detection_output.hpp index 0231d20eba90a3..bd3689ee662df5 100644 --- a/ngraph/core/include/ngraph/op/experimental_detectron_detection_output.hpp +++ b/ngraph/core/include/ngraph/op/experimental_detectron_detection_output.hpp @@ -10,65 +10,12 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/experimental_detectron_detection_output.hpp" namespace ngraph { namespace op { namespace v6 { -/// \brief An operation ExperimentalDetectronDetectionOutput performs -/// non-maximum suppression to generate the detection output using -/// information on location and score predictions. -class NGRAPH_API ExperimentalDetectronDetectionOutput : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Structure that specifies attributes of the operation - struct Attributes { - // specifies score threshold - float score_threshold; - // specifies NMS threshold - float nms_threshold; - // specifies maximal delta of logarithms for width and height - float max_delta_log_wh; - // specifies number of detected classes - int64_t num_classes; - // specifies maximal number of detections per class - int64_t post_nms_count; - // specifies maximual number of detections per image - size_t max_detections_per_image; - // a flag specifies whether to delete background classes or not - // `true` means background classes should be deleted, - // `false` means background classes shouldn't be deleted. - bool class_agnostic_box_regression; - // specifies deltas of weights - std::vector deltas_weights; - }; - - ExperimentalDetectronDetectionOutput() = default; - /// \brief Constructs a ExperimentalDetectronDetectionOutput operation. - /// - /// \param input_rois Input rois - /// \param input_deltas Input deltas - /// \param input_scores Input scores - /// \param input_im_info Input image info - /// \param attrs Attributes attributes - ExperimentalDetectronDetectionOutput(const Output& input_rois, - const Output& input_deltas, - const Output& input_scores, - const Output& input_im_info, - const Attributes& attrs); - bool visit_attributes(AttributeVisitor& visitor) override; - - void validate_and_infer_types() override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - /// \brief Returns attributes of the operation ExperimentalDetectronDetectionOutput - const Attributes& get_attrs() const { - return m_attrs; - } - -private: - Attributes m_attrs; -}; +using ov::op::v6::ExperimentalDetectronDetectionOutput; } // namespace v6 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp b/ngraph/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp index 2abb9d5d5939a8..26cf040ec39560 100644 --- a/ngraph/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp +++ b/ngraph/core/include/ngraph/op/experimental_detectron_generate_proposals.hpp @@ -10,55 +10,12 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/experimental_detectron_generate_proposals.hpp" namespace ngraph { namespace op { namespace v6 { -/// \brief An operation ExperimentalDetectronGenerateProposalsSingleImage -/// computes ROIs and their scores based on input data. -class NGRAPH_API ExperimentalDetectronGenerateProposalsSingleImage : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Structure that specifies attributes of the operation - struct Attributes { - // minimum box width & height - float min_size; - // specifies NMS threshold - float nms_threshold; - // number of top-n proposals after NMS - int64_t post_nms_count; - // number of top-n proposals before NMS - int64_t pre_nms_count; - }; - - ExperimentalDetectronGenerateProposalsSingleImage() = default; - /// \brief Constructs a ExperimentalDetectronGenerateProposalsSingleImage operation. - /// - /// \param im_info Input image info - /// \param anchors Input anchors - /// \param deltas Input deltas - /// \param scores Input scores - /// \param attrs Operation attributes - ExperimentalDetectronGenerateProposalsSingleImage(const Output& im_info, - const Output& anchors, - const Output& deltas, - const Output& scores, - const Attributes& attrs); - - bool visit_attributes(AttributeVisitor& visitor) override; - - void validate_and_infer_types() override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - const Attributes& get_attrs() const { - return m_attrs; - } - -private: - Attributes m_attrs; -}; +using ov::op::v6::ExperimentalDetectronGenerateProposalsSingleImage; } // namespace v6 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp b/ngraph/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp index c109412cc780a4..ded6e775721a9c 100644 --- a/ngraph/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp +++ b/ngraph/core/include/ngraph/op/experimental_detectron_prior_grid_generator.hpp @@ -10,58 +10,12 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/experimental_detectron_prior_grid_generator.hpp" namespace ngraph { namespace op { namespace v6 { -/// \brief An operation ExperimentalDetectronPriorGridGenerator generates prior -/// grids of specified sizes. -class NGRAPH_API ExperimentalDetectronPriorGridGenerator : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Structure that specifies attributes of the operation - struct Attributes { - // Specifies whether the output tensor should be 2D or 4D - // `true` means the output tensor should be 2D tensor, - // `false` means the output tensor should be 4D tensor. - bool flatten; - // Specifies number of cells of the generated grid with respect to height. - int64_t h; - // Specifies number of cells of the generated grid with respect to width. - int64_t w; - // Specifies the step of generated grid with respect to x coordinate - float stride_x; - // Specifies the step of generated grid with respect to y coordinate - float stride_y; - }; - - ExperimentalDetectronPriorGridGenerator() = default; - /// \brief Constructs a ExperimentalDetectronDetectionOutput operation. - /// - /// \param priors Input priors - /// \param feature_map Input feature map - /// \param im_data Image data - /// \param attrs attributes - ExperimentalDetectronPriorGridGenerator(const Output& priors, - const Output& feature_map, - const Output& im_data, - const Attributes& attrs); - bool visit_attributes(AttributeVisitor& visitor) override; - - void validate_and_infer_types() override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - /// \brief Returns attributes of this operation. - const Attributes& get_attrs() const { - return m_attrs; - } - -private: - Attributes m_attrs; - - void validate(); -}; +using ov::op::v6::ExperimentalDetectronPriorGridGenerator; } // namespace v6 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/experimental_detectron_roi_feature.hpp b/ngraph/core/include/ngraph/op/experimental_detectron_roi_feature.hpp index 675573ba254166..6c4043456f7376 100644 --- a/ngraph/core/include/ngraph/op/experimental_detectron_roi_feature.hpp +++ b/ngraph/core/include/ngraph/op/experimental_detectron_roi_feature.hpp @@ -11,49 +11,12 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/experimental_detectron_roi_feature.hpp" namespace ngraph { namespace op { namespace v6 { -/// \brief An operation ExperimentalDetectronROIFeatureExtractor -/// is the ROIAlign operation applied over a feature pyramid. -class NGRAPH_API ExperimentalDetectronROIFeatureExtractor : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Structure that specifies attributes of the operation - struct Attributes { - int64_t output_size; - int64_t sampling_ratio; - std::vector pyramid_scales; - bool aligned; - }; - - ExperimentalDetectronROIFeatureExtractor() = default; - /// \brief Constructs a ExperimentalDetectronROIFeatureExtractor operation. - /// - /// \param args Inputs of ExperimentalDetectronROIFeatureExtractor - /// \param attrs Operation attributes - ExperimentalDetectronROIFeatureExtractor(const OutputVector& args, const Attributes& attrs); - - /// \brief Constructs a ExperimentalDetectronROIFeatureExtractor operation. - /// - /// \param args Inputs of ExperimentalDetectronROIFeatureExtractor - /// \param attrs Operation attributes - ExperimentalDetectronROIFeatureExtractor(const NodeVector& args, const Attributes& attrs); - bool visit_attributes(AttributeVisitor& visitor) override; - - void validate_and_infer_types() override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - /// \brief Returns attributes of the operation. - const Attributes& get_attrs() const { - return m_attrs; - } - -private: - Attributes m_attrs; -}; +using ov::op::v6::ExperimentalDetectronROIFeatureExtractor; } // namespace v6 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/experimental_detectron_topkrois.hpp b/ngraph/core/include/ngraph/op/experimental_detectron_topkrois.hpp index 17f6bd591f3ddf..91f56825d90554 100644 --- a/ngraph/core/include/ngraph/op/experimental_detectron_topkrois.hpp +++ b/ngraph/core/include/ngraph/op/experimental_detectron_topkrois.hpp @@ -10,36 +10,12 @@ #include "ngraph/attribute_adapter.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/experimental_detectron_topkrois.hpp" namespace ngraph { namespace op { namespace v6 { -/// \brief An operation ExperimentalDetectronTopKROIs, according to the repository -/// is TopK operation applied to probabilities of input ROIs. -class NGRAPH_API ExperimentalDetectronTopKROIs : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - ExperimentalDetectronTopKROIs() = default; - /// \brief Constructs a ExperimentalDetectronTopKROIs operation. - /// - /// \param input_rois Input rois - /// \param rois_probs Probabilities for input rois - /// \param max_rois Maximal numbers of output rois - ExperimentalDetectronTopKROIs(const Output& input_rois, const Output& rois_probs, size_t max_rois = 0); - - void validate_and_infer_types() override; - bool visit_attributes(AttributeVisitor& visitor) override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - size_t get_max_rois() const { - return m_max_rois; - } - -private: - size_t m_max_rois; -}; +using ov::op::v6::ExperimentalDetectronTopKROIs; } // namespace v6 } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/ngraph/op/extractimagepatches.hpp b/ngraph/core/include/ngraph/op/extractimagepatches.hpp index ae3eb3ed62b9c4..8c427d1087672a 100644 --- a/ngraph/core/include/ngraph/op/extractimagepatches.hpp +++ b/ngraph/core/include/ngraph/op/extractimagepatches.hpp @@ -5,66 +5,12 @@ #pragma once #include "ngraph/op/op.hpp" +#include "openvino/op/extractimagepatches.hpp" namespace ngraph { namespace op { namespace v3 { -class NGRAPH_API ExtractImagePatches : public Op { -public: - NGRAPH_RTTI_DECLARATION; - - ExtractImagePatches() = default; - /// \brief Constructs a ExtractImagePatches operation - /// - /// \param data 4-D Input data to extract image patches - /// \param sizes Patch size in the format of [size_rows, size_cols] - /// \param strides Patch movement stride in the format of [stride_rows, stride_cols] - /// \param rates Element seleciton rate for creating a patch. in the format of - /// [rate_rows, rate_cols] - /// \param auto_pad Padding type. it can be any value from - /// valid, same_lower, same_upper - ExtractImagePatches(const Output& image, - const Shape& sizes, - const Strides& strides, - const Shape& rates, - const PadType& auto_pad); - - void validate_and_infer_types() override; - bool visit_attributes(AttributeVisitor& visitor) override; - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - const Shape& get_sizes() const { - return m_patch_sizes; - } - void set_sizes(const Shape& sizes) { - m_patch_sizes = sizes; - } - const Strides& get_strides() const { - return m_patch_movement_strides; - } - void set_strides(const Strides& strides) { - m_patch_movement_strides = strides; - } - const Shape& get_rates() const { - return m_patch_selection_rates; - } - void set_rates(const Shape& rates) { - m_patch_selection_rates = rates; - } - const PadType& get_auto_pad() const { - return m_padding; - } - void set_auto_pad(PadType& padding) { - m_padding = padding; - } - -private: - Shape m_patch_sizes; - Strides m_patch_movement_strides; - Shape m_patch_selection_rates; - PadType m_padding; -}; +using ov::op::v3::ExtractImagePatches; } // namespace v3 using v3::ExtractImagePatches; } // namespace op diff --git a/ngraph/core/include/ngraph/op/fake_quantize.hpp b/ngraph/core/include/ngraph/op/fake_quantize.hpp index 00c970bf8fd415..d36772c2dc9c53 100644 --- a/ngraph/core/include/ngraph/op/fake_quantize.hpp +++ b/ngraph/core/include/ngraph/op/fake_quantize.hpp @@ -7,76 +7,12 @@ #include "ngraph/node.hpp" #include "ngraph/op/op.hpp" #include "ngraph/op/util/attr_types.hpp" +#include "openvino/op/fake_quantize.hpp" namespace ngraph { namespace op { namespace v0 { -/// -/// \brief Class performing element-wise linear quantization. -/// -/// \note Input floating point values are quantized into a discrete -/// set of floating point values. -/// -/// \paragraph Implementation This class creates a node which performs the following -/// operation: -/// -/// round((data - input_low) / (input_high - input_low) * (levels-1)) / -/// (levels-1) * (output_high - output_low) + output_low -/// -/// -class NGRAPH_API FakeQuantize : public ngraph::op::Op { -public: - NGRAPH_RTTI_DECLARATION; - - FakeQuantize(); - /// - /// \brief Constructs a FakeQuantize operation node. - /// - /// \param[in] data The input data tensor. - /// \param[in] input_low The minimum limit for input values. - /// \param[in] input_high The maximum limit for input values. - /// \param[in] output_low The minimum quantized value. - /// \param[in] output_high The maximum quantized value. - /// \param[in] levels The number of quantization levels. - /// \param[in] auto_broadcast AutoBroadcast mode to be used for broadcasting - /// limit values - /// - FakeQuantize(const Output& data, - const Output& input_low, - const Output& input_high, - const Output& output_low, - const Output& output_high, - std::size_t levels, - const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); - - bool visit_attributes(AttributeVisitor& visitor) override; - virtual void validate_and_infer_types() override; - - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - std::size_t get_levels() const { - return m_levels; - } - void set_levels(std::size_t levels) { - m_levels = levels; - } - const AutoBroadcastSpec& get_auto_broadcast() const { - return m_auto_broadcast; - } - void set_auto_broadcast(const AutoBroadcastSpec& auto_broadcast) { - m_auto_broadcast = auto_broadcast; - } - - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; - bool constant_fold(OutputVector& output_values, const OutputVector& inputs_values) override { - return false; - } - -private: - std::size_t m_levels; - AutoBroadcastSpec m_auto_broadcast = op::AutoBroadcastType::NUMPY; -}; +using ov::op::v0::FakeQuantize; } // namespace v0 using v0::FakeQuantize; } // namespace op diff --git a/ngraph/core/include/ngraph/op/floor.hpp b/ngraph/core/include/ngraph/op/floor.hpp index 6196f8f689c2b4..e58ce80b042b57 100644 --- a/ngraph/core/include/ngraph/op/floor.hpp +++ b/ngraph/core/include/ngraph/op/floor.hpp @@ -5,26 +5,12 @@ #pragma once #include "ngraph/op/util/unary_elementwise_arithmetic.hpp" +#include "openvino/op/floor.hpp" namespace ngraph { namespace op { namespace v0 { -/// \brief Elementwise floor operation. -class NGRAPH_API Floor : public util::UnaryElementwiseArithmetic { -public: - NGRAPH_RTTI_DECLARATION; - /// \brief Constructs a floor operation. - Floor() = default; - /// \brief Constructs a floor operation. - /// - /// \param arg Node that produces the input tensor. - Floor(const Output& arg); - - bool visit_attributes(AttributeVisitor& visitor) override; - virtual std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; -}; +using ov::op::v0::Floor; } // namespace v0 using v0::Floor; } // namespace op diff --git a/ngraph/core/include/ngraph/op/floor_mod.hpp b/ngraph/core/include/ngraph/op/floor_mod.hpp index 2ce6441af991b0..b4fd0f9309eb68 100644 --- a/ngraph/core/include/ngraph/op/floor_mod.hpp +++ b/ngraph/core/include/ngraph/op/floor_mod.hpp @@ -7,40 +7,13 @@ #include #include "ngraph/op/util/binary_elementwise_arithmetic.hpp" +#include "openvino/op/floor_mod.hpp" namespace ngraph { namespace op { namespace v1 { -/// \brief Elementwise FloorMod operation. -/// -class NGRAPH_API FloorMod : public util::BinaryElementwiseArithmetic { -public: - NGRAPH_RTTI_DECLARATION; - - /// \brief Constructs an uninitialized addition operation - FloorMod() : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY){}; - - /// \brief Constructs an Floor Mod operation. - /// - /// \param arg0 Output that produces the first input tensor.
- /// `[d0, ...]` - /// \param arg1 Output that produces the second input tensor.
- /// `[d0, ...]` - /// \param auto_broadcast Auto broadcast specification - /// - /// Output `[d0, ...]` - /// - FloorMod(const Output& arg0, - const Output& arg1, - const AutoBroadcastSpec& auto_broadcast = AutoBroadcastType::NUMPY); - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - bool visit_attributes(AttributeVisitor& visitor) override; - bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; - bool has_evaluate() const override; -}; +using ov::op::v1::FloorMod; } // namespace v1 - using v1::FloorMod; } // namespace op } // namespace ngraph diff --git a/ngraph/core/include/openvino/op/deformable_convolution.hpp b/ngraph/core/include/openvino/op/deformable_convolution.hpp new file mode 100644 index 00000000000000..3670ee1a059626 --- /dev/null +++ b/ngraph/core/include/openvino/op/deformable_convolution.hpp @@ -0,0 +1,175 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/core/coordinate_diff.hpp" +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" +#include "openvino/op/util/deformable_convolution_base.hpp" + +namespace ov { +namespace op { +namespace v1 { +/// \brief DeformableConvolution operation. +class OPENVINO_API DeformableConvolution : public op::util::DeformableConvolutionBase { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Constructs a conversion operation. + DeformableConvolution() = default; + /// \brief Constructs a conversion operation. + /// + /// \param arg Node that produces the input tensor. + /// \param offsets Node producing the deformable values tensor. + /// \param filters Node producing the filters(kernels) tensor with OIZYX + /// layout. + /// \param strides Convolution strides. + /// \param pads_begin Amount of padding to be added to the beginning along + /// each axis. For example in case of a 2D input the value + /// of (1, 2) means that 1 element will be added to the + /// top and 2 elements to the left. + /// \param pads_end Amount of padding to be added to the end along each + /// axis. + /// \param dilations The distance in width and height between the weights + /// in the filters tensor. + /// \param auto_pad Specifies how the automatic calculation of padding + /// should be done. + /// \param group The number of groups which both output and input + /// should be split into. + /// \param deformable_group The number of groups which deformable values and + /// output should be split into along the channel axis. + DeformableConvolution(const Output& arg, + const Output& offsets, + const Output& filters, + const Strides& strides, + const CoordinateDiff& pads_begin, + const CoordinateDiff& pads_end, + const Strides& dilations, + const PadType& auto_pad = PadType::EXPLICIT, + const int64_t group = 1, + const int64_t deformable_group = 1); + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; +}; +} // namespace v1 + +namespace v8 { +class OPENVINO_API DeformableConvolution : public op::util::DeformableConvolutionBase { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Constructs a conversion operation. + DeformableConvolution() = default; + /// \brief Constructs a conversion operation. + /// + /// \param arg Node that produces the input tensor. + /// \param offsets Node producing the deformable values tensor. + /// \param filters Node producing the filters(kernels) tensor with OIZYX + /// layout. + /// \param strides Convolution strides. + /// \param pads_begin Amount of padding to be added to the beginning along + /// each axis. For example in case of a 2D input the value + /// of (1, 2) means that 1 element will be added to the + /// top and 2 elements to the left. + /// \param pads_end Amount of padding to be added to the end along each + /// axis. + /// \param dilations The distance in width and height between the weights + /// in the filters tensor. + /// \param auto_pad Specifies how the automatic calculation of padding + /// should be done. + /// \param group The number of groups which both output and input + /// should be split into. + /// \param deformable_group The number of groups which deformable values and + /// output should be split into along the channel axis. + /// \param bilinear_interpolation_pad + /// The flag that determines the mode of bilinear + /// interpolation execution. + /// If the flag is `true` and the sampling location is + /// within one pixel outside of the feature map boundary, + /// then bilinear interpolation is performed on the zero + /// padded feature map. If the flag is `false` and the + /// sampling location is within one pixel outside of the + /// feature map boundary, then the sampling location + /// shifts to the inner boundary of the feature map.` + DeformableConvolution(const Output& arg, + const Output& offsets, + const Output& filters, + const Strides& strides, + const CoordinateDiff& pads_begin, + const CoordinateDiff& pads_end, + const Strides& dilations, + const PadType& auto_pad = PadType::EXPLICIT, + const int64_t group = 1, + const int64_t deformable_group = 1, + const bool bilinear_interpolation_pad = false); + + /// \brief Constructs a conversion operation. + /// + /// \param arg Node that produces the input tensor. + /// \param offsets Node producing the deformable values tensor. + /// \param filters Node producing the filters(kernels) tensor with OIZYX + /// layout. + /// \param mask Node producing the mask(mask) tensor. + /// \param strides Convolution strides. + /// \param pads_begin Amount of padding to be added to the beginning along + /// each axis. For example in case of a 2D input the value + /// of (1, 2) means that 1 element will be added to the + /// top and 2 elements to the left. + /// \param pads_end Amount of padding to be added to the end along each + /// axis. + /// \param dilations The distance in width and height between the weights + /// in the filters tensor. + /// \param auto_pad Specifies how the automatic calculation of padding + /// should be done. + /// \param group The number of groups which both output and input + /// should be split into. + /// \param deformable_group The number of groups which deformable values and + /// output should be split into along the channel axis. + /// \param bilinear_interpolation_pad + /// The flag that determines the mode of bilinear + /// interpolation execution. + /// If the flag is `true` and the sampling location is + /// within one pixel outside of the feature map boundary, + /// then bilinear interpolation is performed on the zero + /// padded feature map. If the flag is `false` and the + /// sampling location is within one pixel outside of the + /// feature map boundary, then the sampling location + /// shifts to the inner boundary of the feature map. + DeformableConvolution(const Output& arg, + const Output& offsets, + const Output& filters, + const Output& mask, + const Strides& strides, + const CoordinateDiff& pads_begin, + const CoordinateDiff& pads_end, + const Strides& dilations, + const PadType& auto_pad = PadType::EXPLICIT, + const int64_t group = 1, + const int64_t deformable_group = 1, + const bool bilinear_interpolation_pad = false); + bool visit_attributes(AttributeVisitor& visitor) override; + + void validate_and_infer_types() override; + + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + + bool has_evaluate() const override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + bool get_bilinear_interpolation_pad() const { + return m_bilinear_interpolation_pad; + } + + void set_bilinear_interpolation_pad(const bool bilinear_interpolation_pad) { + m_bilinear_interpolation_pad = bilinear_interpolation_pad; + } + +private: + bool m_bilinear_interpolation_pad; +}; +} // namespace v8 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/deformable_psroi_pooling.hpp b/ngraph/core/include/openvino/op/deformable_psroi_pooling.hpp new file mode 100644 index 00000000000000..06ee5c551f44fd --- /dev/null +++ b/ngraph/core/include/openvino/op/deformable_psroi_pooling.hpp @@ -0,0 +1,107 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" + +namespace ov { +namespace op { +namespace v1 { +class OPENVINO_API DeformablePSROIPooling : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + DeformablePSROIPooling() = default; + /// \brief Constructs a DeformablePSROIPooling operation + /// + /// \param input Input tensor with position sensitive score maps + /// \param coords Input tensor with list of five element tuples + /// describing ROI coordinates + /// \param offsets Input tensor with transformation values + /// \param output_dim Pooled output channel number + /// \param group_size Number of horizontal bins per row to divide ROI area, + /// it defines output width and height + /// \param spatial_scale Multiplicative spatial scale factor to translate ROI + /// coordinates from their input scale to the scale used when + /// pooling + /// \param mode Specifies mode for pooling. + /// \param spatial_bins_x Specifies numbers of bins to divide ROI single + /// bin over width + /// \param spatial_bins_y Specifies numbers of bins to divide ROI single + /// bin over height + /// \param no_trans The flag that specifies whenever third input exists + /// and contains transformation (offset) values + /// \param trans_std The value that all transformation (offset) values are + /// multiplied with + /// \param part_size The number of parts the output tensor spatial dimensions + /// are divided into. Basically it is the height + /// and width of the third input + DeformablePSROIPooling(const Output& input, + const Output& coords, + const Output& offsets, + const int64_t output_dim, + const float spatial_scale, + const int64_t group_size = 1, + const std::string mode = "bilinear_deformable", + int64_t spatial_bins_x = 1, + int64_t spatial_bins_y = 1, + float trans_std = 1, + int64_t part_size = 1); + + DeformablePSROIPooling(const Output& input, + const Output& coords, + const int64_t output_dim, + const float spatial_scale, + const int64_t group_size = 1, + const std::string mode = "bilinear_deformable", + int64_t spatial_bins_x = 1, + int64_t spatial_bins_y = 1, + float trans_std = 1, + int64_t part_size = 1); + + bool visit_attributes(AttributeVisitor& visitor) override; + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + int64_t get_output_dim() const { + return m_output_dim; + } + int64_t get_group_size() const { + return m_group_size; + } + float get_spatial_scale() const { + return m_spatial_scale; + } + const std::string& get_mode() const { + return m_mode; + } + int64_t get_spatial_bins_x() const { + return m_spatial_bins_x; + } + int64_t get_spatial_bins_y() const { + return m_spatial_bins_y; + } + float get_trans_std() const { + return m_trans_std; + } + int64_t get_part_size() const { + return m_part_size; + } + +private: + int64_t m_output_dim; + float m_spatial_scale; + int64_t m_group_size = 1; + std::string m_mode = "bilinear_deformable"; + int64_t m_spatial_bins_x = 1; + int64_t m_spatial_bins_y = 1; + float m_trans_std = 1.f; + int64_t m_part_size = 1; +}; +} // namespace v1 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/depth_to_space.hpp b/ngraph/core/include/openvino/op/depth_to_space.hpp new file mode 100644 index 00000000000000..216359dcf5852f --- /dev/null +++ b/ngraph/core/include/openvino/op/depth_to_space.hpp @@ -0,0 +1,78 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace op { +namespace v0 { +/// \brief DepthToSpace permutes data from the depth dimension of the input blob into +/// spatial dimensions. +/// +/// \note Values from the depth dimension (assuming NCHW layout) are moved in +/// spatial blocks to the height and width dimensions. +/// +/// Output node produces a tensor with shape: +/// [N, C/(blocksize * blocksize), H * blocksize, W * blocksize] +class OPENVINO_API DepthToSpace : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + enum class DepthToSpaceMode { + // The input depth is divided to [block_size, ..., block_size, new_depth] + BLOCKS_FIRST, + // The input depth is divided to [new_depth, block_size, ..., block_size] + DEPTH_FIRST + }; + + DepthToSpace() = default; + /// \brief Constructs a DepthToSpace operation. + /// + /// \param data Node producing the input tensor + /// \param mode Specifies how the input depth dimension is split to block + /// coordinates + /// \param block_size The size of the block of values to be moved + DepthToSpace(const Output& data, const DepthToSpaceMode& mode, std::size_t block_size = 1); + + DepthToSpace(const Output& data, const std::string& mode, std::size_t block_size = 1); + bool visit_attributes(AttributeVisitor& visitor) override; + + std::size_t get_block_size() const { + return m_blocksize; + } + DepthToSpaceMode get_mode() const { + return m_mode; + } + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + void validate_and_infer_types() override; + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; + +protected: + std::size_t m_blocksize; + DepthToSpaceMode m_mode; +}; +} // namespace v0 +} // namespace op + +OPENVINO_API +std::ostream& operator<<(std::ostream& s, const op::v0::DepthToSpace::DepthToSpaceMode& type); + +template <> +class OPENVINO_API AttributeAdapter + : public EnumAttributeAdapterBase { +public: + AttributeAdapter(op::v0::DepthToSpace::DepthToSpaceMode& value) + : EnumAttributeAdapterBase(value) {} + + static constexpr DiscreteTypeInfo type_info{"AttributeAdapter", 0}; + const DiscreteTypeInfo& get_type_info() const override { + return type_info; + } +}; + +} // namespace ov diff --git a/ngraph/core/include/openvino/op/detection_output.hpp b/ngraph/core/include/openvino/op/detection_output.hpp new file mode 100644 index 00000000000000..26c9d9828a9b2e --- /dev/null +++ b/ngraph/core/include/openvino/op/detection_output.hpp @@ -0,0 +1,78 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" + +namespace ov { +namespace op { +namespace v0 { +/// \brief Layer which performs non-max suppression to +/// generate detection output using location and confidence predictions +class OPENVINO_API DetectionOutput : public Op { +public: + struct Attributes { + int num_classes; + int background_label_id = 0; + int top_k = -1; + bool variance_encoded_in_target = false; + std::vector keep_top_k; + std::string code_type = std::string{"caffe.PriorBoxParameter.CORNER"}; + bool share_location = true; + float nms_threshold; + float confidence_threshold = 0; + bool clip_after_nms = false; + bool clip_before_nms = false; + bool decrease_label_id = false; + bool normalized = false; + size_t input_height = 1; + size_t input_width = 1; + float objectness_score = 0; + }; + + OPENVINO_RTTI_DECLARATION; + + DetectionOutput() = default; + /// \brief Constructs a DetectionOutput operation + /// + /// \param box_logits Box logits + /// \param class_preds Class predictions + /// \param proposals Proposals + /// \param aux_class_preds Auxilary class predictions + /// \param aux_box_preds Auxilary box predictions + /// \param attrs Detection Output attributes + DetectionOutput(const Output& box_logits, + const Output& class_preds, + const Output& proposals, + const Output& aux_class_preds, + const Output& aux_box_preds, + const Attributes& attrs); + + /// \brief Constructs a DetectionOutput operation + /// + /// \param box_logits Box logits + /// \param class_preds Class predictions + /// \param proposals Proposals + /// \param attrs Detection Output attributes + DetectionOutput(const Output& box_logits, + const Output& class_preds, + const Output& proposals, + const Attributes& attrs); + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + const Attributes& get_attrs() const { + return m_attrs; + } + bool visit_attributes(AttributeVisitor& visitor) override; + +private: + Attributes m_attrs; +}; +} // namespace v0 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/dft.hpp b/ngraph/core/include/openvino/op/dft.hpp new file mode 100644 index 00000000000000..954bcb7f5f677b --- /dev/null +++ b/ngraph/core/include/openvino/op/dft.hpp @@ -0,0 +1,53 @@ +//***************************************************************************** +// Copyright 2017-2021 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +//***************************************************************************** + +#pragma once + +#include +#include + +#include "openvino/op/op.hpp" +#include "openvino/op/util/fft_base.hpp" + +namespace ov { +namespace op { +namespace v7 { +/// \brief An operation DFT that computes the discrete Fourier transformation. +class OPENVINO_API DFT : public util::FFTBase { +public: + OPENVINO_RTTI_DECLARATION; + DFT() = default; + + /// \brief Constructs a DFT operation. DFT is performed for full size axes. + /// + /// \param data Input data + /// \param axes Axes to perform DFT + DFT(const Output& data, const Output& axes); + + /// \brief Constructs a DFT operation. + /// + /// \param data Input data + /// \param axes Axes to perform DFT + /// \param signal_size Signal sizes for 'axes' + DFT(const Output& data, const Output& axes, const Output& signal_size); + + bool visit_attributes(AttributeVisitor& visitor) override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; +}; +} // namespace v7 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/divide.hpp b/ngraph/core/include/openvino/op/divide.hpp new file mode 100644 index 00000000000000..065c5f641e0dfd --- /dev/null +++ b/ngraph/core/include/openvino/op/divide.hpp @@ -0,0 +1,55 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/util/binary_elementwise_arithmetic.hpp" + +namespace ov { +namespace op { +namespace v1 { +/// \brief Elementwise division operation. +class OPENVINO_API Divide : public util::BinaryElementwiseArithmetic { +public: + OPENVINO_RTTI_DECLARATION; + /// \brief Constructs a division operation. + Divide() : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY) {} + + /// \brief Constructs a division operation. + /// + /// \param arg0 Node that produces the first input tensor. + /// \param arg1 Node that produces the second input tensor. + /// \param pythondiv Use Python style rounding for integral type + /// \param auto_broadcast Auto broadcast specification + Divide(const Output& arg0, + const Output& arg1, + bool pythondiv, + const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); + + /// \brief Constructs a division operation. + /// + /// \param arg0 Node that produces the first input tensor. + /// \param arg1 Node that produces the second input tensor. + /// \param auto_broadcast Auto broadcast specification + Divide(const Output& arg0, + const Output& arg1, + const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); + bool visit_attributes(AttributeVisitor& visitor) override; + bool is_pythondiv() const { + return m_pythondiv; + } + void set_is_pythondiv(bool pythondiv) { + m_pythondiv = pythondiv; + } + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; + +protected: + bool m_pythondiv{true}; +}; +} // namespace v1 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/einsum.hpp b/ngraph/core/include/openvino/op/einsum.hpp new file mode 100644 index 00000000000000..14f10ba8b884c0 --- /dev/null +++ b/ngraph/core/include/openvino/op/einsum.hpp @@ -0,0 +1,71 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" + +namespace ov { +namespace op { +namespace v7 { +/// \brief Einsum operation. +class OPENVINO_API Einsum : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + Einsum() = default; + + /// + /// \brief Constructs Einsum operation. + /// + /// \param inputs Input nodes on which Einsum operation performs + /// contraction + /// + /// \param equation Einstein summation convention + /// + Einsum(const OutputVector& inputs, const std::string& equation); + + void validate_and_infer_types() override; + + bool visit_attributes(AttributeVisitor& visitor) override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + /// \brief Get an equation of Einsum operation + /// + /// \return Einsum equation + /// + std::string get_equation() const { + return m_equation; + } + + /// \brief Check correctness of equation format and extract input subscripts + /// and output subscript + /// + /// \param equation Equation to be parsed and checked + /// + /// \param input_subscripts A vector of extracted input subscripts + /// + /// \param output_subscript An output subscript + /// + static void parse_equation(const std::string& equation, + std::vector& input_subscripts, + std::string& output_subscript); + + /// \brief Extract labels (from subscript) that can be alphabetic letters or + /// ellipsis + /// + /// \param subscript Subscript + /// + /// \return A vector of extracted labels from the input subscript in the order + /// of appearence + /// + static std::vector extract_labels(const std::string& subscript); + +private: + std::string m_equation; +}; +} // namespace v7 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/elu.hpp b/ngraph/core/include/openvino/op/elu.hpp new file mode 100644 index 00000000000000..eb9c8aaa093e87 --- /dev/null +++ b/ngraph/core/include/openvino/op/elu.hpp @@ -0,0 +1,41 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" + +namespace ov { +namespace op { +namespace v0 { +/// \brief Exponential Linear Unit +/// x < 0 => f(x) = alpha * (exp(x) - 1.) +/// x >= 0 => f(x) = x +/// +class OPENVINO_API Elu : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + Elu() = default; + /// \brief Constructs an Elu operation. + /// + /// \param data Input tensor + /// \param alpha Multiplier for negative values + Elu(const Output& data, const double alpha); + + bool visit_attributes(AttributeVisitor& visitor) override; + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + double get_alpha() const { + return m_alpha; + } + +private: + double m_alpha; +}; +} // namespace v0 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/embedding_segments_sum.hpp b/ngraph/core/include/openvino/op/embedding_segments_sum.hpp new file mode 100644 index 00000000000000..fb73228343eeff --- /dev/null +++ b/ngraph/core/include/openvino/op/embedding_segments_sum.hpp @@ -0,0 +1,77 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/core/axis_set.hpp" +#include "openvino/op/util/index_reduction.hpp" + +namespace ov { +namespace op { +namespace v3 { +/// \brief Returns embeddings for given indices +class OPENVINO_API EmbeddingSegmentsSum : public Op { +public: + OPENVINO_RTTI_DECLARATION; + /// \brief Constructs a EmbeddingSegmentsSum operation. + EmbeddingSegmentsSum() = default; + /// \brief Constructs a EmbeddingSegmentsSum operation. + /// + /// EmbeddingSegmentsSum constructs an output tensor by replacing every index in a + /// given + /// input tensor with a row (from the weights matrix) at that index + /// + /// \param 'emb_table' tensor containing the embedding lookup table of the module of + /// shape [num_emb, emb_dim1, emb_dim2, ...] and of type T + /// \param 'indices' tensor of shape [num_indices] and of type T_IND. Required + /// \param `segment_ids` tensor of shape `[num_indices]` and of type *T_IND* with + /// indices + /// into the output Tensor. Values should be sorted and can be repeated. Required. + /// \param `num_segments` scalar of type *T_IND* indicating the number of segments. + /// Required. + /// \param 'default_index' scalar of type T_IND containing default index in + /// embedding + /// table to fill empty "bags". If not provided empty "bags" + /// are filled with zeros. Optional. + /// \param 'per_sample_weights' tensor of the same shape as indices and of type T. + /// Each value in this tensor are multiplied with each + /// value pooled from embedding table for each index. Optional. + + EmbeddingSegmentsSum(const Output& emb_table, + const Output& indices, + const Output& segment_ids, + const Output& num_segments, + const Output& default_index, + const Output& per_sample_weights); + + EmbeddingSegmentsSum(const Output& emb_table, + const Output& indices, + const Output& segment_ids, + const Output& num_segments, + const Output& default_index); + + EmbeddingSegmentsSum(const Output& emb_table, + const Output& indices, + const Output& segment_ids, + const Output& num_segments); + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + bool visit_attributes(AttributeVisitor&) override { + return true; + } + +private: + static constexpr int EMB_TABLE = 0; + static constexpr int INDICES = 1; + static constexpr int SEGMENT_IDS = 2; + static constexpr int NUM_SEGMENTS = 3; + static constexpr int DEFAULT_INDEX = 4; + static constexpr int PER_SAMPLE_WEIGHTS = 5; +}; +} // namespace v3 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/embeddingbag_offsets_sum.hpp b/ngraph/core/include/openvino/op/embeddingbag_offsets_sum.hpp new file mode 100644 index 00000000000000..0d2326c3a57dab --- /dev/null +++ b/ngraph/core/include/openvino/op/embeddingbag_offsets_sum.hpp @@ -0,0 +1,55 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/core/axis_set.hpp" +#include "openvino/op/util/embeddingbag_offsets_base.hpp" +#include "openvino/op/util/index_reduction.hpp" + +namespace ov { +namespace op { +namespace v3 { +/// \brief Returns embeddings for given indices +class OPENVINO_API EmbeddingBagOffsetsSum : public util::EmbeddingBagOffsetsBase { +public: + OPENVINO_RTTI_DECLARATION; + /// \brief Constructs a EmbeddingBagOffsetsSum operation. + EmbeddingBagOffsetsSum() = default; + /// \brief Constructs a EmbeddingBagOffsetsSum operation. + /// + /// EmbeddingBagOffsetsSum constructs an output tensor by replacing every index in a + /// given + /// input tensor with a row (from the weights matrix) at that index + /// + /// \param emb_table tensor containing the embedding lookup table of the module of + /// shape [num_emb, emb_dim1, emb_dim2, ...] and of type T + /// \param tensor of shape [num_indices] and of type T_IND. Required + /// \param offsets tensor of shape [batch] and of type T_IND containing the starting + /// index positions of each "bag" in indices. Required. + /// \param default_index scalar of type T_IND containing default index in embedding + /// table to fill empty "bags". If not provided empty "bags" + /// are filled with zeros. Optional. + /// \param per_sample_weigths tensor of the same shape as indices and of type T. + /// Each value in this tensor are multiplied with each + /// value pooled from embedding table for each index. Optional. + + EmbeddingBagOffsetsSum(const Output& emb_table, + const Output& indices, + const Output& offsets, + const Output& default_index, + const Output& per_sample_weights); + + EmbeddingBagOffsetsSum(const Output& emb_table, + const Output& indices, + const Output& offsets, + const Output& default_index); + + EmbeddingBagOffsetsSum(const Output& emb_table, const Output& indices, const Output& offsets); + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; +}; +} // namespace v3 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/embeddingbag_packedsum.hpp b/ngraph/core/include/openvino/op/embeddingbag_packedsum.hpp new file mode 100644 index 00000000000000..68c3dc3f96ff05 --- /dev/null +++ b/ngraph/core/include/openvino/op/embeddingbag_packedsum.hpp @@ -0,0 +1,44 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/core/axis_set.hpp" +#include "openvino/op/util/embeddingbag_packed_base.hpp" +#include "openvino/op/util/index_reduction.hpp" + +namespace ov { +namespace op { +namespace v3 { +/// \brief Returns embeddings for given indices +class OPENVINO_API EmbeddingBagPackedSum : public util::EmbeddingBagPackedBase { +public: + OPENVINO_RTTI_DECLARATION; + /// \brief Constructs a EmbeddingBagPackedSum operation. + EmbeddingBagPackedSum() = default; + /// \brief Constructs a EmbeddingBagPackedSum operation. + /// + /// EmbeddingBagPackedSum constructs an output tensor by replacing every index in a + /// given + /// input tensor with a row (from the weights matrix) at that index + /// + /// \param emb_table Tensor containing the embedding lookup table of the module of + /// shape [num_emb, emb_dim1, emb_dim2, ...] and of type T + /// \param indices Tensor of shape `[batch, indices_per_bag]` and of type *T_IND*. + /// Required. + /// \param per_sample_weigths tensor of the same shape as indices and of type T. + /// Each value in this tensor are multiplied with each + /// value pooled from embedding table for each index. Optional. + + EmbeddingBagPackedSum(const Output& emb_table, + const Output& indices, + const Output& per_sample_weights); + + EmbeddingBagPackedSum(const Output& emb_table, const Output& indices); + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; +}; +} // namespace v3 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/equal.hpp b/ngraph/core/include/openvino/op/equal.hpp new file mode 100644 index 00000000000000..ce73248ffcbe6d --- /dev/null +++ b/ngraph/core/include/openvino/op/equal.hpp @@ -0,0 +1,51 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/util/binary_elementwise_comparison.hpp" + +namespace ov { +namespace op { +namespace v1 { +// clang-format off +/// \brief Elementwise is-equal operation. +/// +/// ## Inputs +/// +/// | | Type | Description | +/// | ------ | --------------------------------- | ------------------------------------------------------ | +/// | `arg0` | \f$E[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of any shape and element type. | +/// | `arg1` | \f$E[d_1,\dots,d_n]~(n \geq 0)\f$ | A tensor of the same shape and element type as `arg0`. | +/// | `autob`| AutoBroadcastSpec | Auto broadcast specification. | +/// +/// ## Output +/// +/// | Type | Description | +/// | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | +/// | \f$\texttt{bool}[d_1,\dots,d_n]\f$ | The tensor \f$T\f$, where \f$T[i_1,\dots,i_n] = 1\text{ if }\texttt{arg0}[i_1,\dots,i_n] = \texttt{arg1}[i_1,\dots,i_n]\text{, else } 0\f$ | +// clang-format on +class OPENVINO_API Equal : public util::BinaryElementwiseComparison { +public: + OPENVINO_RTTI_DECLARATION; + /// \brief Constructs an equal operation. + Equal() : util::BinaryElementwiseComparison(AutoBroadcastSpec::NUMPY) {} + /// \brief Constructs an equal operation. + /// + /// \param arg0 Node that produces the first input tensor. + /// \param arg1 Node that produces the second input tensor. + /// \param auto_broadcast Auto broadcast specification + Equal(const Output& arg0, + const Output& arg1, + const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); + + bool visit_attributes(AttributeVisitor& visitor) override; + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; +}; +} // namespace v1 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/erf.hpp b/ngraph/core/include/openvino/op/erf.hpp new file mode 100644 index 00000000000000..b3be867dda93b5 --- /dev/null +++ b/ngraph/core/include/openvino/op/erf.hpp @@ -0,0 +1,30 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/util/unary_elementwise_arithmetic.hpp" + +namespace ov { +namespace op { +namespace v0 { +/// \brief Elementwise erf operation. +class OPENVINO_API Erf : public util::UnaryElementwiseArithmetic { +public: + OPENVINO_RTTI_DECLARATION; + /// \brief Constructs a floor operation. + Erf() = default; + /// \brief Constructs a floor operation. + /// + /// \param arg Node that produces the input tensor. + Erf(const Output& arg); + + bool visit_attributes(AttributeVisitor& visitor) override; + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; +}; +} // namespace v0 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/exp.hpp b/ngraph/core/include/openvino/op/exp.hpp new file mode 100644 index 00000000000000..7bb23dbd3f6012 --- /dev/null +++ b/ngraph/core/include/openvino/op/exp.hpp @@ -0,0 +1,32 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/util/unary_elementwise_arithmetic.hpp" + +namespace ov { +namespace op { +namespace v0 { +/// \brief Elementwise natural exponential (exp) operation. +class OPENVINO_API Exp : public util::UnaryElementwiseArithmetic { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Constructs an exponential operation. + Exp() = default; + /// \brief Constructs an exponential operation. + /// + /// \param arg Node that produces the input tensor. + Exp(const Output& arg); + + bool visit_attributes(AttributeVisitor& visitor) override; + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; +}; +} // namespace v0 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/experimental_detectron_detection_output.hpp b/ngraph/core/include/openvino/op/experimental_detectron_detection_output.hpp new file mode 100644 index 00000000000000..4f04bf2a0bf03e --- /dev/null +++ b/ngraph/core/include/openvino/op/experimental_detectron_detection_output.hpp @@ -0,0 +1,74 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include + +#include "openvino/core/attribute_adapter.hpp" +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace op { +namespace v6 { +/// \brief An operation ExperimentalDetectronDetectionOutput performs +/// non-maximum suppression to generate the detection output using +/// information on location and score predictions. +class OPENVINO_API ExperimentalDetectronDetectionOutput : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Structure that specifies attributes of the operation + struct Attributes { + // specifies score threshold + float score_threshold; + // specifies NMS threshold + float nms_threshold; + // specifies maximal delta of logarithms for width and height + float max_delta_log_wh; + // specifies number of detected classes + int64_t num_classes; + // specifies maximal number of detections per class + int64_t post_nms_count; + // specifies maximual number of detections per image + size_t max_detections_per_image; + // a flag specifies whether to delete background classes or not + // `true` means background classes should be deleted, + // `false` means background classes shouldn't be deleted. + bool class_agnostic_box_regression; + // specifies deltas of weights + std::vector deltas_weights; + }; + + ExperimentalDetectronDetectionOutput() = default; + /// \brief Constructs a ExperimentalDetectronDetectionOutput operation. + /// + /// \param input_rois Input rois + /// \param input_deltas Input deltas + /// \param input_scores Input scores + /// \param input_im_info Input image info + /// \param attrs Attributes attributes + ExperimentalDetectronDetectionOutput(const Output& input_rois, + const Output& input_deltas, + const Output& input_scores, + const Output& input_im_info, + const Attributes& attrs); + bool visit_attributes(AttributeVisitor& visitor) override; + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + /// \brief Returns attributes of the operation ExperimentalDetectronDetectionOutput + const Attributes& get_attrs() const { + return m_attrs; + } + +private: + Attributes m_attrs; +}; +} // namespace v6 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/experimental_detectron_generate_proposals.hpp b/ngraph/core/include/openvino/op/experimental_detectron_generate_proposals.hpp new file mode 100644 index 00000000000000..c17fdcae970e28 --- /dev/null +++ b/ngraph/core/include/openvino/op/experimental_detectron_generate_proposals.hpp @@ -0,0 +1,64 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include + +#include "openvino/core/attribute_adapter.hpp" +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace op { +namespace v6 { +/// \brief An operation ExperimentalDetectronGenerateProposalsSingleImage +/// computes ROIs and their scores based on input data. +class OPENVINO_API ExperimentalDetectronGenerateProposalsSingleImage : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Structure that specifies attributes of the operation + struct Attributes { + // minimum box width & height + float min_size; + // specifies NMS threshold + float nms_threshold; + // number of top-n proposals after NMS + int64_t post_nms_count; + // number of top-n proposals before NMS + int64_t pre_nms_count; + }; + + ExperimentalDetectronGenerateProposalsSingleImage() = default; + /// \brief Constructs a ExperimentalDetectronGenerateProposalsSingleImage operation. + /// + /// \param im_info Input image info + /// \param anchors Input anchors + /// \param deltas Input deltas + /// \param scores Input scores + /// \param attrs Operation attributes + ExperimentalDetectronGenerateProposalsSingleImage(const Output& im_info, + const Output& anchors, + const Output& deltas, + const Output& scores, + const Attributes& attrs); + + bool visit_attributes(AttributeVisitor& visitor) override; + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + const Attributes& get_attrs() const { + return m_attrs; + } + +private: + Attributes m_attrs; +}; +} // namespace v6 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/experimental_detectron_prior_grid_generator.hpp b/ngraph/core/include/openvino/op/experimental_detectron_prior_grid_generator.hpp new file mode 100644 index 00000000000000..14933e22dff81e --- /dev/null +++ b/ngraph/core/include/openvino/op/experimental_detectron_prior_grid_generator.hpp @@ -0,0 +1,67 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include + +#include "openvino/core/attribute_adapter.hpp" +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace op { +namespace v6 { +/// \brief An operation ExperimentalDetectronPriorGridGenerator generates prior +/// grids of specified sizes. +class OPENVINO_API ExperimentalDetectronPriorGridGenerator : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Structure that specifies attributes of the operation + struct Attributes { + // Specifies whether the output tensor should be 2D or 4D + // `true` means the output tensor should be 2D tensor, + // `false` means the output tensor should be 4D tensor. + bool flatten; + // Specifies number of cells of the generated grid with respect to height. + int64_t h; + // Specifies number of cells of the generated grid with respect to width. + int64_t w; + // Specifies the step of generated grid with respect to x coordinate + float stride_x; + // Specifies the step of generated grid with respect to y coordinate + float stride_y; + }; + + ExperimentalDetectronPriorGridGenerator() = default; + /// \brief Constructs a ExperimentalDetectronDetectionOutput operation. + /// + /// \param priors Input priors + /// \param feature_map Input feature map + /// \param im_data Image data + /// \param attrs attributes + ExperimentalDetectronPriorGridGenerator(const Output& priors, + const Output& feature_map, + const Output& im_data, + const Attributes& attrs); + bool visit_attributes(AttributeVisitor& visitor) override; + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + /// \brief Returns attributes of this operation. + const Attributes& get_attrs() const { + return m_attrs; + } + +private: + Attributes m_attrs; + + void validate(); +}; +} // namespace v6 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/experimental_detectron_roi_feature.hpp b/ngraph/core/include/openvino/op/experimental_detectron_roi_feature.hpp new file mode 100644 index 00000000000000..052b7c0bc4b439 --- /dev/null +++ b/ngraph/core/include/openvino/op/experimental_detectron_roi_feature.hpp @@ -0,0 +1,59 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include +#include + +#include "openvino/core/attribute_adapter.hpp" +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace op { +namespace v6 { +/// \brief An operation ExperimentalDetectronROIFeatureExtractor +/// is the ROIAlign operation applied over a feature pyramid. +class OPENVINO_API ExperimentalDetectronROIFeatureExtractor : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Structure that specifies attributes of the operation + struct Attributes { + int64_t output_size; + int64_t sampling_ratio; + std::vector pyramid_scales; + bool aligned; + }; + + ExperimentalDetectronROIFeatureExtractor() = default; + /// \brief Constructs a ExperimentalDetectronROIFeatureExtractor operation. + /// + /// \param args Inputs of ExperimentalDetectronROIFeatureExtractor + /// \param attrs Operation attributes + ExperimentalDetectronROIFeatureExtractor(const OutputVector& args, const Attributes& attrs); + + /// \brief Constructs a ExperimentalDetectronROIFeatureExtractor operation. + /// + /// \param args Inputs of ExperimentalDetectronROIFeatureExtractor + /// \param attrs Operation attributes + ExperimentalDetectronROIFeatureExtractor(const NodeVector& args, const Attributes& attrs); + bool visit_attributes(AttributeVisitor& visitor) override; + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + /// \brief Returns attributes of the operation. + const Attributes& get_attrs() const { + return m_attrs; + } + +private: + Attributes m_attrs; +}; +} // namespace v6 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/experimental_detectron_topkrois.hpp b/ngraph/core/include/openvino/op/experimental_detectron_topkrois.hpp new file mode 100644 index 00000000000000..50f73ac5588694 --- /dev/null +++ b/ngraph/core/include/openvino/op/experimental_detectron_topkrois.hpp @@ -0,0 +1,45 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include +#include + +#include "openvino/core/attribute_adapter.hpp" +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace op { +namespace v6 { +/// \brief An operation ExperimentalDetectronTopKROIs, according to the repository +/// is TopK operation applied to probabilities of input ROIs. +class OPENVINO_API ExperimentalDetectronTopKROIs : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + ExperimentalDetectronTopKROIs() = default; + /// \brief Constructs a ExperimentalDetectronTopKROIs operation. + /// + /// \param input_rois Input rois + /// \param rois_probs Probabilities for input rois + /// \param max_rois Maximal numbers of output rois + ExperimentalDetectronTopKROIs(const Output& input_rois, const Output& rois_probs, size_t max_rois = 0); + + void validate_and_infer_types() override; + bool visit_attributes(AttributeVisitor& visitor) override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + size_t get_max_rois() const { + return m_max_rois; + } + +private: + size_t m_max_rois; +}; +} // namespace v6 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/extractimagepatches.hpp b/ngraph/core/include/openvino/op/extractimagepatches.hpp new file mode 100644 index 00000000000000..bd738d0cf105a5 --- /dev/null +++ b/ngraph/core/include/openvino/op/extractimagepatches.hpp @@ -0,0 +1,70 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" + +namespace ov { +namespace op { +namespace v3 { +class OPENVINO_API ExtractImagePatches : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + ExtractImagePatches() = default; + /// \brief Constructs a ExtractImagePatches operation + /// + /// \param data 4-D Input data to extract image patches + /// \param sizes Patch size in the format of [size_rows, size_cols] + /// \param strides Patch movement stride in the format of [stride_rows, stride_cols] + /// \param rates Element seleciton rate for creating a patch. in the format of + /// [rate_rows, rate_cols] + /// \param auto_pad Padding type. it can be any value from + /// valid, same_lower, same_upper + ExtractImagePatches(const Output& image, + const ngraph::Shape& sizes, + const Strides& strides, + const ngraph::Shape& rates, + const PadType& auto_pad); + + void validate_and_infer_types() override; + bool visit_attributes(AttributeVisitor& visitor) override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + const ngraph::Shape& get_sizes() const { + return m_patch_sizes; + } + void set_sizes(const ngraph::Shape& sizes) { + m_patch_sizes = sizes; + } + const Strides& get_strides() const { + return m_patch_movement_strides; + } + void set_strides(const Strides& strides) { + m_patch_movement_strides = strides; + } + const ngraph::Shape& get_rates() const { + return m_patch_selection_rates; + } + void set_rates(const ngraph::Shape& rates) { + m_patch_selection_rates = rates; + } + const PadType& get_auto_pad() const { + return m_padding; + } + void set_auto_pad(PadType& padding) { + m_padding = padding; + } + +private: + ngraph::Shape m_patch_sizes; + Strides m_patch_movement_strides; + ngraph::Shape m_patch_selection_rates; + PadType m_padding; +}; +} // namespace v3 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/fake_quantize.hpp b/ngraph/core/include/openvino/op/fake_quantize.hpp new file mode 100644 index 00000000000000..86f10ec377896c --- /dev/null +++ b/ngraph/core/include/openvino/op/fake_quantize.hpp @@ -0,0 +1,81 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" +#include "openvino/op/util/attr_types.hpp" + +namespace ov { +namespace op { +namespace v0 { +/// +/// \brief Class performing element-wise linear quantization. +/// +/// \note Input floating point values are quantized into a discrete +/// set of floating point values. +/// +/// \paragraph Implementation This class creates a node which performs the following +/// operation: +/// +/// round((data - input_low) / (input_high - input_low) * (levels-1)) / +/// (levels-1) * (output_high - output_low) + output_low +/// +/// +class OPENVINO_API FakeQuantize : public Op { +public: + OPENVINO_RTTI_DECLARATION; + + FakeQuantize(); + /// + /// \brief Constructs a FakeQuantize operation node. + /// + /// \param[in] data The input data tensor. + /// \param[in] input_low The minimum limit for input values. + /// \param[in] input_high The maximum limit for input values. + /// \param[in] output_low The minimum quantized value. + /// \param[in] output_high The maximum quantized value. + /// \param[in] levels The number of quantization levels. + /// \param[in] auto_broadcast AutoBroadcast mode to be used for broadcasting + /// limit values + /// + FakeQuantize(const Output& data, + const Output& input_low, + const Output& input_high, + const Output& output_low, + const Output& output_high, + std::size_t levels, + const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY)); + + bool visit_attributes(AttributeVisitor& visitor) override; + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + + std::size_t get_levels() const { + return m_levels; + } + void set_levels(std::size_t levels) { + m_levels = levels; + } + const AutoBroadcastSpec& get_auto_broadcast() const { + return m_auto_broadcast; + } + void set_auto_broadcast(const AutoBroadcastSpec& auto_broadcast) { + m_auto_broadcast = auto_broadcast; + } + + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; + bool constant_fold(OutputVector& output_values, const OutputVector& inputs_values) override { + return false; + } + +private: + std::size_t m_levels; + AutoBroadcastSpec m_auto_broadcast = op::AutoBroadcastType::NUMPY; +}; +} // namespace v0 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/floor.hpp b/ngraph/core/include/openvino/op/floor.hpp new file mode 100644 index 00000000000000..a5a759d4d944fb --- /dev/null +++ b/ngraph/core/include/openvino/op/floor.hpp @@ -0,0 +1,30 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/util/unary_elementwise_arithmetic.hpp" + +namespace ov { +namespace op { +namespace v0 { +/// \brief Elementwise floor operation. +class OPENVINO_API Floor : public util::UnaryElementwiseArithmetic { +public: + OPENVINO_RTTI_DECLARATION; + /// \brief Constructs a floor operation. + Floor() = default; + /// \brief Constructs a floor operation. + /// + /// \param arg Node that produces the input tensor. + Floor(const Output& arg); + + bool visit_attributes(AttributeVisitor& visitor) override; + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; +}; +} // namespace v0 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/floor_mod.hpp b/ngraph/core/include/openvino/op/floor_mod.hpp new file mode 100644 index 00000000000000..a26bbe34bdfd2d --- /dev/null +++ b/ngraph/core/include/openvino/op/floor_mod.hpp @@ -0,0 +1,42 @@ +// Copyright (C) 2018-2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/util/binary_elementwise_arithmetic.hpp" + +namespace ov { +namespace op { +namespace v1 { +/// \brief Elementwise FloorMod operation. +/// +class OPENVINO_API FloorMod : public util::BinaryElementwiseArithmetic { +public: + OPENVINO_RTTI_DECLARATION; + + /// \brief Constructs an uninitialized addition operation + FloorMod() : util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NUMPY){}; + + /// \brief Constructs an Floor Mod operation. + /// + /// \param arg0 Output that produces the first input tensor.
+ /// `[d0, ...]` + /// \param arg1 Output that produces the second input tensor.
+ /// `[d0, ...]` + /// \param auto_broadcast Auto broadcast specification + /// + /// Output `[d0, ...]` + /// + FloorMod(const Output& arg0, + const Output& arg1, + const AutoBroadcastSpec& auto_broadcast = AutoBroadcastType::NUMPY); + + std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; + bool visit_attributes(AttributeVisitor& visitor) override; + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; + bool has_evaluate() const override; +}; +} // namespace v1 +} // namespace op +} // namespace ov diff --git a/ngraph/core/include/openvino/op/util/embeddingbag_offsets_base.hpp b/ngraph/core/include/openvino/op/util/embeddingbag_offsets_base.hpp index c7a6f5d7147768..ea755e81a5713e 100644 --- a/ngraph/core/include/openvino/op/util/embeddingbag_offsets_base.hpp +++ b/ngraph/core/include/openvino/op/util/embeddingbag_offsets_base.hpp @@ -13,10 +13,7 @@ namespace util { /// \brief Returns embeddings for given indices class OPENVINO_API EmbeddingBagOffsetsBase : public Op { public: - static constexpr NodeTypeInfo type_info{"EmbeddingBagOffsetsBase", 3}; - const NodeTypeInfo& get_type_info() const override { - return type_info; - } + OPENVINO_RTTI_DECLARATION; /// \brief Constructs a EmbeddingBagOffsetsBase operation. EmbeddingBagOffsetsBase() = default; /// \brief Constructs a EmbeddingBagOffsetsBase operation. diff --git a/ngraph/core/include/openvino/op/util/embeddingbag_packed_base.hpp b/ngraph/core/include/openvino/op/util/embeddingbag_packed_base.hpp index 9e23eb38962796..89929fa31714cc 100644 --- a/ngraph/core/include/openvino/op/util/embeddingbag_packed_base.hpp +++ b/ngraph/core/include/openvino/op/util/embeddingbag_packed_base.hpp @@ -13,10 +13,7 @@ namespace util { /// \brief Returns embeddings for given indices class OPENVINO_API EmbeddingBagPackedBase : public Op { public: - static constexpr NodeTypeInfo type_info{"EmbeddingBagPackedBase", 3}; - const NodeTypeInfo& get_type_info() const override { - return type_info; - } + OPENVINO_RTTI_DECLARATION; /// \brief Constructs a EmbeddingBagPackedBase operation. EmbeddingBagPackedBase() = default; /// \brief Constructs a EmbeddingBagPackedBase operation. diff --git a/ngraph/core/src/op/deformable_convolution.cpp b/ngraph/core/src/op/deformable_convolution.cpp index ad993c06cae97b..54ecd9cc3e1475 100644 --- a/ngraph/core/src/op/deformable_convolution.cpp +++ b/ngraph/core/src/op/deformable_convolution.cpp @@ -14,8 +14,14 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v1::DeformableConvolution, "DeformableConvolution", 1, op::util::DeformableConvolutionBase); -NGRAPH_RTTI_DEFINITION(op::v8::DeformableConvolution, "DeformableConvolution", 8, op::util::DeformableConvolutionBase); +OPENVINO_RTTI_DEFINITION(op::v1::DeformableConvolution, + "DeformableConvolution", + 1, + op::util::DeformableConvolutionBase); +OPENVINO_RTTI_DEFINITION(op::v8::DeformableConvolution, + "DeformableConvolution", + 8, + op::util::DeformableConvolutionBase); op::v8::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 5e6821112de6db..ac82f76745b20c 100644 --- a/ngraph/core/src/op/deformable_psroi_pooling.cpp +++ b/ngraph/core/src/op/deformable_psroi_pooling.cpp @@ -9,7 +9,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v1::DeformablePSROIPooling, "DeformablePSROIPooling", 1); +OPENVINO_RTTI_DEFINITION(op::v1::DeformablePSROIPooling, "DeformablePSROIPooling", 1); op::v1::DeformablePSROIPooling::DeformablePSROIPooling(const Output& input, const Output& coords, diff --git a/ngraph/core/src/op/depth_to_space.cpp b/ngraph/core/src/op/depth_to_space.cpp index 3fd9aff40973ee..2b24cc8daa08f7 100644 --- a/ngraph/core/src/op/depth_to_space.cpp +++ b/ngraph/core/src/op/depth_to_space.cpp @@ -16,7 +16,7 @@ using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v0::DepthToSpace, "DepthToSpace", 0); +OPENVINO_RTTI_DEFINITION(op::v0::DepthToSpace, "DepthToSpace", 0); op::DepthToSpace::DepthToSpace(const Output& data, const DepthToSpaceMode& mode, const size_t block_size) : Op({data}), @@ -113,7 +113,7 @@ bool op::DepthToSpace::has_evaluate() const { return !get_input_partial_shape(0).is_dynamic(); } -std::ostream& ngraph::operator<<(std::ostream& s, const op::DepthToSpace::DepthToSpaceMode& type) { +std::ostream& ov::operator<<(std::ostream& s, const ov::op::v0::DepthToSpace::DepthToSpaceMode& type) { return s << as_string(type); } diff --git a/ngraph/core/src/op/detection_output.cpp b/ngraph/core/src/op/detection_output.cpp index bd49fcf80729a8..5ade2c7ff14796 100644 --- a/ngraph/core/src/op/detection_output.cpp +++ b/ngraph/core/src/op/detection_output.cpp @@ -7,31 +7,30 @@ #include "itt.hpp" using namespace std; -using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::DetectionOutput, "DetectionOutput", 0); +OPENVINO_RTTI_DEFINITION(ov::op::v0::DetectionOutput, "DetectionOutput", 0); -op::DetectionOutput::DetectionOutput(const Output& box_logits, - const Output& class_preds, - const Output& proposals, - const Output& aux_class_preds, - const Output& aux_box_preds, - const DetectionOutputAttrs& attrs) +ov::op::v0::DetectionOutput::DetectionOutput(const Output& box_logits, + const Output& class_preds, + const Output& proposals, + const Output& aux_class_preds, + const Output& aux_box_preds, + const Attributes& attrs) : Op({box_logits, class_preds, proposals, aux_class_preds, aux_box_preds}), m_attrs(attrs) { constructor_validate_and_infer_types(); } -op::DetectionOutput::DetectionOutput(const Output& box_logits, - const Output& class_preds, - const Output& proposals, - const DetectionOutputAttrs& attrs) +ov::op::v0::DetectionOutput::DetectionOutput(const Output& box_logits, + const Output& class_preds, + const Output& proposals, + const Attributes& attrs) : Op({box_logits, class_preds, proposals}), m_attrs(attrs) { constructor_validate_and_infer_types(); } -void op::DetectionOutput::validate_and_infer_types() { +void ov::op::v0::DetectionOutput::validate_and_infer_types() { NGRAPH_OP_SCOPE(v0_DetectionOutput_validate_and_infer_types); NODE_VALIDATION_CHECK(this, m_attrs.num_classes > 0, "Number of classes must be greater than zero"); @@ -205,12 +204,12 @@ void op::DetectionOutput::validate_and_infer_types() { } else { output_shape.push_back(num_images * num_prior_boxes * m_attrs.num_classes); } - output_shape.push_back(7); + output_shape.emplace_back(7); set_output_type(0, box_logits_et, output_shape); } -shared_ptr op::DetectionOutput::clone_with_new_inputs(const OutputVector& new_args) const { +shared_ptr ov::op::v0::DetectionOutput::clone_with_new_inputs(const OutputVector& new_args) const { NGRAPH_OP_SCOPE(v0_DetectionOutput_clone_with_new_inputs); check_new_args_count(this, new_args); @@ -230,7 +229,7 @@ shared_ptr op::DetectionOutput::clone_with_new_inputs(const OutputVector& } } -bool op::DetectionOutput::visit_attributes(AttributeVisitor& visitor) { +bool ov::op::v0::DetectionOutput::visit_attributes(AttributeVisitor& visitor) { NGRAPH_OP_SCOPE(v0_DetectionOutput_visit_attributes); visitor.on_attribute("num_classes", m_attrs.num_classes); visitor.on_attribute("background_label_id", m_attrs.background_label_id); diff --git a/ngraph/core/src/op/dft.cpp b/ngraph/core/src/op/dft.cpp index a6f31b5b7d8fe8..b473e165e19e08 100644 --- a/ngraph/core/src/op/dft.cpp +++ b/ngraph/core/src/op/dft.cpp @@ -31,7 +31,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v7::DFT, "DFT", 7, util::FFTBase); +OPENVINO_RTTI_DEFINITION(op::v7::DFT, "DFT", 7, util::FFTBase); op::v7::DFT::DFT(const Output& data, const Output& axes) : FFTBase(data, axes) { constructor_validate_and_infer_types(); diff --git a/ngraph/core/src/op/divide.cpp b/ngraph/core/src/op/divide.cpp index b6f07f90b987e9..3620fe54c967fc 100644 --- a/ngraph/core/src/op/divide.cpp +++ b/ngraph/core/src/op/divide.cpp @@ -53,7 +53,7 @@ bool evaluate_divide(const HostTensorPtr& arg0, // ------------------------------ v1 ------------------------------------------- -NGRAPH_RTTI_DEFINITION(op::v1::Divide, "Divide", 1, util::BinaryElementwiseArithmetic); +OPENVINO_RTTI_DEFINITION(op::v1::Divide, "Divide", 1, util::BinaryElementwiseArithmetic); op::v1::Divide::Divide(const Output& arg0, const Output& arg1, const AutoBroadcastSpec& auto_broadcast) : BinaryElementwiseArithmetic(arg0, arg1, auto_broadcast) { diff --git a/ngraph/core/src/op/einsum.cpp b/ngraph/core/src/op/einsum.cpp index dd7ceba0b41552..2cc2fd3ef14433 100644 --- a/ngraph/core/src/op/einsum.cpp +++ b/ngraph/core/src/op/einsum.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v7::Einsum, "Einsum", 7); +OPENVINO_RTTI_DEFINITION(op::v7::Einsum, "Einsum", 7); op::v7::Einsum::Einsum(const OutputVector& inputs, const std::string& equation) : Op(inputs), m_equation(equation) { // normalize input equation by removing extra white-spaces from the equation diff --git a/ngraph/core/src/op/elu.cpp b/ngraph/core/src/op/elu.cpp index fad636d9b4eca0..76d27b589432b2 100644 --- a/ngraph/core/src/op/elu.cpp +++ b/ngraph/core/src/op/elu.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::Elu, "Elu", 0); +OPENVINO_RTTI_DEFINITION(op::v0::Elu, "Elu", 0); op::Elu::Elu(const Output& data, const double alpha) : Op({data}), m_alpha{alpha} { constructor_validate_and_infer_types(); diff --git a/ngraph/core/src/op/embedding_segments_sum.cpp b/ngraph/core/src/op/embedding_segments_sum.cpp index f95facfec2748a..96ca10ba481259 100644 --- a/ngraph/core/src/op/embedding_segments_sum.cpp +++ b/ngraph/core/src/op/embedding_segments_sum.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v3::EmbeddingSegmentsSum::type_info; +OPENVINO_RTTI_DEFINITION(op::v3::EmbeddingSegmentsSum, "EmbeddingSegmentsSum", 3); op::v3::EmbeddingSegmentsSum::EmbeddingSegmentsSum(const Output& emb_table, const Output& indices, diff --git a/ngraph/core/src/op/embeddingbag_offsets_sum.cpp b/ngraph/core/src/op/embeddingbag_offsets_sum.cpp index 25d8472536143d..98b40f48ef2420 100644 --- a/ngraph/core/src/op/embeddingbag_offsets_sum.cpp +++ b/ngraph/core/src/op/embeddingbag_offsets_sum.cpp @@ -10,7 +10,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v3::EmbeddingBagOffsetsSum::type_info; +OPENVINO_RTTI_DEFINITION(op::v3::EmbeddingBagOffsetsSum, "EmbeddingBagOffsetsSum", 3, util::EmbeddingBagOffsetsBase); op::v3::EmbeddingBagOffsetsSum::EmbeddingBagOffsetsSum(const Output& emb_table, const Output& indices, diff --git a/ngraph/core/src/op/embeddingbag_packedsum.cpp b/ngraph/core/src/op/embeddingbag_packedsum.cpp index d3da20a33e4088..d45b13ca85338b 100644 --- a/ngraph/core/src/op/embeddingbag_packedsum.cpp +++ b/ngraph/core/src/op/embeddingbag_packedsum.cpp @@ -10,7 +10,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v3::EmbeddingBagPackedSum::type_info; +OPENVINO_RTTI_DEFINITION(op::v3::EmbeddingBagPackedSum, "EmbeddingBagPackedSum", 3, util::EmbeddingBagPackedBase); op::v3::EmbeddingBagPackedSum::EmbeddingBagPackedSum(const Output& emb_table, const Output& indices, diff --git a/ngraph/core/src/op/equal.cpp b/ngraph/core/src/op/equal.cpp index 7cf02c9d39f4a7..f024f7b6af4ecf 100644 --- a/ngraph/core/src/op/equal.cpp +++ b/ngraph/core/src/op/equal.cpp @@ -50,7 +50,7 @@ bool evaluate_equal(const HostTensorPtr& arg0, //------------------------------- v1 ------------------------------------------- -NGRAPH_RTTI_DEFINITION(op::v1::Equal, "Equal", 1, op::util::BinaryElementwiseComparison); +OPENVINO_RTTI_DEFINITION(op::v1::Equal, "Equal", 1, op::util::BinaryElementwiseComparison); op::v1::Equal::Equal(const Output& arg0, const Output& arg1, const AutoBroadcastSpec& auto_broadcast) : BinaryElementwiseComparison(arg0, arg1, auto_broadcast) { diff --git a/ngraph/core/src/op/erf.cpp b/ngraph/core/src/op/erf.cpp index 8fdfe5222cd607..5315f447715a47 100644 --- a/ngraph/core/src/op/erf.cpp +++ b/ngraph/core/src/op/erf.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v0::Erf, "Erf", 0, util::UnaryElementwiseArithmetic); +OPENVINO_RTTI_DEFINITION(op::v0::Erf, "Erf", 0, util::UnaryElementwiseArithmetic); bool ngraph::op::v0::Erf::visit_attributes(AttributeVisitor& visitor) { NGRAPH_OP_SCOPE(v0_Erf_visit_attributes); diff --git a/ngraph/core/src/op/exp.cpp b/ngraph/core/src/op/exp.cpp index 5e030eeadb805b..8d841b235638af 100644 --- a/ngraph/core/src/op/exp.cpp +++ b/ngraph/core/src/op/exp.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::Exp, "Exp", 0, UnaryElementwiseArithmetic); +OPENVINO_RTTI_DEFINITION(op::v0::Exp, "Exp", 0, UnaryElementwiseArithmetic); op::Exp::Exp(const Output& arg) : UnaryElementwiseArithmetic(arg) { constructor_validate_and_infer_types(); diff --git a/ngraph/core/src/op/experimental_detectron_detection_output.cpp b/ngraph/core/src/op/experimental_detectron_detection_output.cpp index 25d1c8b4554933..a0b7717fd4eca6 100644 --- a/ngraph/core/src/op/experimental_detectron_detection_output.cpp +++ b/ngraph/core/src/op/experimental_detectron_detection_output.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v6::ExperimentalDetectronDetectionOutput, "ExperimentalDetectronDetectionOutput", 6); +OPENVINO_RTTI_DEFINITION(op::v6::ExperimentalDetectronDetectionOutput, "ExperimentalDetectronDetectionOutput", 6); op::v6::ExperimentalDetectronDetectionOutput::ExperimentalDetectronDetectionOutput(const Output& input_rois, const Output& input_deltas, diff --git a/ngraph/core/src/op/experimental_detectron_generate_proposals.cpp b/ngraph/core/src/op/experimental_detectron_generate_proposals.cpp index 114542ea8802ef..d27c6bb2b9872c 100644 --- a/ngraph/core/src/op/experimental_detectron_generate_proposals.cpp +++ b/ngraph/core/src/op/experimental_detectron_generate_proposals.cpp @@ -12,9 +12,9 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v6::ExperimentalDetectronGenerateProposalsSingleImage, - "ExperimentalDetectronGenerateProposalsSingleImage", - 6); +OPENVINO_RTTI_DEFINITION(op::v6::ExperimentalDetectronGenerateProposalsSingleImage, + "ExperimentalDetectronGenerateProposalsSingleImage", + 6); op::v6::ExperimentalDetectronGenerateProposalsSingleImage::ExperimentalDetectronGenerateProposalsSingleImage( const Output& im_info, diff --git a/ngraph/core/src/op/experimental_detectron_prior_grid_generator.cpp b/ngraph/core/src/op/experimental_detectron_prior_grid_generator.cpp index ab93a19ba6fe81..42ea322e950411 100644 --- a/ngraph/core/src/op/experimental_detectron_prior_grid_generator.cpp +++ b/ngraph/core/src/op/experimental_detectron_prior_grid_generator.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v6::ExperimentalDetectronPriorGridGenerator, "ExperimentalDetectronPriorGridGenerator", 6); +OPENVINO_RTTI_DEFINITION(op::v6::ExperimentalDetectronPriorGridGenerator, "ExperimentalDetectronPriorGridGenerator", 6); op::v6::ExperimentalDetectronPriorGridGenerator::ExperimentalDetectronPriorGridGenerator( const Output& priors, diff --git a/ngraph/core/src/op/experimental_detectron_roi_feature.cpp b/ngraph/core/src/op/experimental_detectron_roi_feature.cpp index bd9b55ba6327af..bd158e5388fd3c 100644 --- a/ngraph/core/src/op/experimental_detectron_roi_feature.cpp +++ b/ngraph/core/src/op/experimental_detectron_roi_feature.cpp @@ -14,7 +14,9 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v6::ExperimentalDetectronROIFeatureExtractor, "ExperimentalDetectronROIFeatureExtractor", 6); +OPENVINO_RTTI_DEFINITION(op::v6::ExperimentalDetectronROIFeatureExtractor, + "ExperimentalDetectronROIFeatureExtractor", + 6); op::v6::ExperimentalDetectronROIFeatureExtractor::ExperimentalDetectronROIFeatureExtractor(const OutputVector& args, const Attributes& attrs) diff --git a/ngraph/core/src/op/experimental_detectron_topkrois.cpp b/ngraph/core/src/op/experimental_detectron_topkrois.cpp index c92fb94defbfb5..6e6c0783862236 100644 --- a/ngraph/core/src/op/experimental_detectron_topkrois.cpp +++ b/ngraph/core/src/op/experimental_detectron_topkrois.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v6::ExperimentalDetectronTopKROIs, "ExperimentalDetectronTopKROIs", 6); +OPENVINO_RTTI_DEFINITION(op::v6::ExperimentalDetectronTopKROIs, "ExperimentalDetectronTopKROIs", 6); op::v6::ExperimentalDetectronTopKROIs::ExperimentalDetectronTopKROIs(const Output& input_rois, const Output& rois_probs, diff --git a/ngraph/core/src/op/extractimagepatches.cpp b/ngraph/core/src/op/extractimagepatches.cpp index 941aa1c70e82b6..362035248271b7 100644 --- a/ngraph/core/src/op/extractimagepatches.cpp +++ b/ngraph/core/src/op/extractimagepatches.cpp @@ -12,7 +12,7 @@ using namespace ngraph; // ExtractImagePatches v3 -NGRAPH_RTTI_DEFINITION(op::v3::ExtractImagePatches, "ExtractImagePatches", 3); +OPENVINO_RTTI_DEFINITION(op::v3::ExtractImagePatches, "ExtractImagePatches", 3); op::v3::ExtractImagePatches::ExtractImagePatches(const Output& image, const Shape& sizes, diff --git a/ngraph/core/src/op/fake_quantize.cpp b/ngraph/core/src/op/fake_quantize.cpp index 324b87b651fd3f..2282612009fb49 100644 --- a/ngraph/core/src/op/fake_quantize.cpp +++ b/ngraph/core/src/op/fake_quantize.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::FakeQuantize, "FakeQuantize", 0); +OPENVINO_RTTI_DEFINITION(op::v0::FakeQuantize, "FakeQuantize", 0); op::FakeQuantize::FakeQuantize() : Op(), m_levels() {} diff --git a/ngraph/core/src/op/floor.cpp b/ngraph/core/src/op/floor.cpp index 22554b7808bb0b..efe732ebe66b79 100644 --- a/ngraph/core/src/op/floor.cpp +++ b/ngraph/core/src/op/floor.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v0::Floor, "Floor", 0, util::UnaryElementwiseArithmetic); +OPENVINO_RTTI_DEFINITION(op::v0::Floor, "Floor", 0, util::UnaryElementwiseArithmetic); op::Floor::Floor(const Output& arg) : UnaryElementwiseArithmetic(arg) { constructor_validate_and_infer_types(); diff --git a/ngraph/core/src/op/floor_mod.cpp b/ngraph/core/src/op/floor_mod.cpp index 6e72f11be28f53..7795900e70ba38 100644 --- a/ngraph/core/src/op/floor_mod.cpp +++ b/ngraph/core/src/op/floor_mod.cpp @@ -11,7 +11,7 @@ using namespace std; using namespace ngraph; -NGRAPH_RTTI_DEFINITION(op::v1::FloorMod, "FloorMod", 1, op::util::BinaryElementwiseArithmetic); +OPENVINO_RTTI_DEFINITION(op::v1::FloorMod, "FloorMod", 1, op::util::BinaryElementwiseArithmetic); op::v1::FloorMod::FloorMod(const Output& arg0, const Output& arg1, const AutoBroadcastSpec& auto_broadcast) : BinaryElementwiseArithmetic(arg0, arg1, auto_broadcast) { diff --git a/ngraph/core/src/op/util/embeddingbag_offsets_base.cpp b/ngraph/core/src/op/util/embeddingbag_offsets_base.cpp index 8a554ab98137bc..358ba88c04352d 100644 --- a/ngraph/core/src/op/util/embeddingbag_offsets_base.cpp +++ b/ngraph/core/src/op/util/embeddingbag_offsets_base.cpp @@ -9,7 +9,7 @@ using namespace std; -constexpr ov::NodeTypeInfo ov::op::util::EmbeddingBagOffsetsBase::type_info; +OPENVINO_RTTI_DEFINITION(ov::op::util::EmbeddingBagOffsetsBase, "EmbeddingBagOffsetsBase", 3); ov::op::util::EmbeddingBagOffsetsBase::EmbeddingBagOffsetsBase(const Output& emb_table, const Output& indices, diff --git a/ngraph/core/src/op/util/embeddingbag_packed_base.cpp b/ngraph/core/src/op/util/embeddingbag_packed_base.cpp index 35b99a00f4186e..734fbd5ff1d1ed 100644 --- a/ngraph/core/src/op/util/embeddingbag_packed_base.cpp +++ b/ngraph/core/src/op/util/embeddingbag_packed_base.cpp @@ -9,7 +9,7 @@ using namespace std; -constexpr ov::NodeTypeInfo ov::op::util::EmbeddingBagPackedBase::type_info; +OPENVINO_RTTI_DEFINITION(ov::op::util::EmbeddingBagPackedBase, "EmbeddingBagPackedBase", 3); ov::op::util::EmbeddingBagPackedBase::EmbeddingBagPackedBase(const Output& emb_table, const Output& indices,