From 388d2bb6f25f468f9b6f6e29eab71a62ca25f25e Mon Sep 17 00:00:00 2001 From: Georgy Krivoruchko Date: Wed, 17 Jan 2024 02:28:39 -0800 Subject: [PATCH] [ONNX] Frontend refactoring (#22178) * Cleanup ngraph headers * Updates of editor.hpp/cpp * Replaced Function by ov::Model in graph.cpp/hpp * Fixed code style * Refactored operations which are needed to build on master --- .../include/onnx_import/core/node.hpp | 8 ++-- .../include/onnx_import/core/operator_set.hpp | 1 - .../include/onnx_import/onnx_utils.hpp | 2 +- .../onnx/frontend/src/core/attribute.hpp | 2 +- .../onnx/frontend/src/core/graph.cpp | 37 ++++++++------- .../onnx/frontend/src/core/graph.hpp | 8 ++-- .../onnx/frontend/src/core/sparse_tensor.hpp | 6 +-- .../onnx/frontend/src/core/transform.hpp | 2 +- .../onnx/frontend/src/core/value_info.hpp | 17 ++++--- .../onnx/frontend/src/edge_mapper.cpp | 2 +- .../onnx/frontend/src/edge_mapper.hpp | 8 ++-- src/frontends/onnx/frontend/src/editor.cpp | 10 ++-- src/frontends/onnx/frontend/src/editor.hpp | 26 +++++------ .../onnx/frontend/src/input_model.cpp | 6 +-- .../onnx/frontend/src/op/conv_integer.cpp | 43 +++++++++-------- .../onnx/frontend/src/op/conv_integer.hpp | 3 +- .../onnx/frontend/src/op/eye_like.cpp | 19 ++++---- .../onnx/frontend/src/op/eye_like.hpp | 1 - src/frontends/onnx/frontend/src/op/loop.cpp | 46 +++++++++---------- src/frontends/onnx/frontend/src/op/loop.hpp | 5 +- .../onnx/frontend/src/op/matmul_integer.cpp | 39 ++++++++-------- .../onnx/frontend/src/op/matmul_integer.hpp | 3 +- .../onnx/frontend/src/ops_bridge.hpp | 1 - .../onnx/frontend/src/utils/common.cpp | 1 - .../onnx/frontend/src/utils/conv_factory.cpp | 1 - .../onnx/frontend/src/utils/convpool.hpp | 1 - .../onnx/frontend/src/utils/reshape.hpp | 9 ++-- .../src/utils/tensor_external_data.cpp | 2 - .../onnx/frontend/src/utils/variadic.hpp | 15 ++---- 29 files changed, 152 insertions(+), 172 deletions(-) diff --git a/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp b/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp index e46c37321820af..ed114552cbdb13 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/core/node.hpp @@ -17,11 +17,11 @@ #include #include -#include "ngraph/deprecated.hpp" -#include "ngraph/except.hpp" -#include "ngraph/node.hpp" -#include "ngraph/op/constant.hpp" #include "onnx_import/onnx_importer_visibility.hpp" +#include "openvino/core/deprecated.hpp" +#include "openvino/core/except.hpp" +#include "openvino/core/node.hpp" +#include "openvino/op/constant.hpp" namespace ONNX_NAMESPACE { // forward declaration diff --git a/src/frontends/onnx/frontend/include/onnx_import/core/operator_set.hpp b/src/frontends/onnx/frontend/include/onnx_import/core/operator_set.hpp index e55ff9cfbf634f..69bb95a62834cb 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/core/operator_set.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/core/operator_set.hpp @@ -8,7 +8,6 @@ #include #include -#include "ngraph/node.hpp" #include "onnx_import/core/node.hpp" namespace ngraph { diff --git a/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp b/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp index 631c689cf0dd66..8e4de8a6605635 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/onnx_utils.hpp @@ -17,9 +17,9 @@ #include #include -#include "ngraph/deprecated.hpp" #include "onnx_import/core/operator_set.hpp" #include "onnx_importer_visibility.hpp" +#include "openvino/core/deprecated.hpp" namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/core/attribute.hpp b/src/frontends/onnx/frontend/src/core/attribute.hpp index 4bd9756bccbbda..ea8bedb5a28d0f 100644 --- a/src/frontends/onnx/frontend/src/core/attribute.hpp +++ b/src/frontends/onnx/frontend/src/core/attribute.hpp @@ -8,7 +8,7 @@ #include "core/sparse_tensor.hpp" #include "core/tensor.hpp" -#include "ngraph/except.hpp" +#include "openvino/core/except.hpp" namespace ngraph { namespace onnx_import { diff --git a/src/frontends/onnx/frontend/src/core/graph.cpp b/src/frontends/onnx/frontend/src/core/graph.cpp index ac94cc4af26746..df61ef1a7371db 100644 --- a/src/frontends/onnx/frontend/src/core/graph.cpp +++ b/src/frontends/onnx/frontend/src/core/graph.cpp @@ -11,7 +11,6 @@ #include "core/transform.hpp" #include "core/value_info.hpp" -#include "default_opset.hpp" #include "exceptions.hpp" #include "onnx_framework_node.hpp" #include "onnx_import/core/node.hpp" @@ -148,7 +147,7 @@ Graph::Graph(const std::string& model_dir, for (const auto& initializer_tensor : m_model->get_graph().initializer()) { if (initializer_tensor.has_name()) { Tensor tensor = Tensor{initializer_tensor, m_model_dir, m_mmap_cache}; - std::shared_ptr ov_constant; + std::shared_ptr ov_constant; // For each initializer create a Constant node and store it in cache try { ov_constant = tensor.get_ov_constant(); @@ -165,7 +164,7 @@ Graph::Graph(const std::string& model_dir, } } - // Process all ONNX graph inputs, convert them to nGraph nodes and store in cache + // Process all ONNX graph inputs, convert them to OV nodes and store in cache for (const auto& input : m_model->get_graph().input()) { // Check if a Constant node was already created from an initializer if (m_cache->contains(input.name())) { @@ -183,7 +182,7 @@ void Graph::convert_to_ov_nodes() { const float total = static_cast(m_model->get_graph().node().size()); unsigned int completed = 0u; std::map op_statistics; - // Process ONNX graph nodes, convert to nGraph nodes + // Process ONNX graph nodes, convert to OV nodes for (const auto& node_proto : m_model->get_graph().node()) { if (m_extensions.telemetry) { op_statistics[node_proto.op_type()]++; @@ -249,10 +248,10 @@ void Graph::set_metadata(std::shared_ptr& model) const { } } -std::shared_ptr Graph::convert() { +std::shared_ptr Graph::convert() { convert_to_ov_nodes(); remove_dangling_parameters(); - auto function = create_function(); + auto function = create_model(); set_metadata(function); return function; } @@ -263,10 +262,10 @@ OutputVector Graph::make_framework_nodes(const Node& onnx_node) { if (onnx_node.has_subgraphs()) { const auto& subgraphs = onnx_node.get_subgraphs(); auto inputs = onnx_node.get_ng_inputs(); - std::vector> functions; + std::vector> models; for (const auto& kv : subgraphs) { auto& subgraph = kv.second; - functions.push_back(subgraph->decode()); + models.push_back(subgraph->decode()); for (const auto& input : subgraph->get_inputs_from_parent()) { const auto& name = input.get_node()->get_friendly_name(); if (std::find_if(inputs.begin(), inputs.end(), [&name](const Output& n) -> bool { @@ -276,7 +275,7 @@ OutputVector Graph::make_framework_nodes(const Node& onnx_node) { } } } - framework_node = std::make_shared(onnx_node, functions, inputs); + framework_node = std::make_shared(onnx_node, models, inputs); } else { framework_node = std::make_shared(onnx_node); } @@ -287,7 +286,7 @@ void Graph::decode_to_framework_nodes() { const float total = static_cast(m_model->get_graph().node().size()); unsigned int completed = 0u; std::map op_statistics; - // Process ONNX graph nodes, convert to nGraph nodes + // Process ONNX graph nodes, convert to OV nodes for (const auto& node_proto : m_model->get_graph().node()) { if (m_extensions.telemetry) { op_statistics[node_proto.op_type()]++; @@ -312,22 +311,22 @@ void Graph::decode_to_framework_nodes() { } OPENVINO_SUPPRESS_DEPRECATED_END -std::shared_ptr Graph::create_function() { - auto function = std::make_shared(get_ov_outputs(), m_parameters, get_name()); +std::shared_ptr Graph::create_model() { + auto model = std::make_shared(get_ov_outputs(), m_parameters, get_name()); const auto& onnx_outputs = m_model->get_graph().output(); - for (std::size_t i{0}; i < function->get_output_size(); ++i) { - const auto& result_node = function->get_output_op(i); + for (std::size_t i{0}; i < model->get_output_size(); ++i) { + const auto& result_node = model->get_output_op(i); const std::string onnx_output_name = onnx_outputs.Get(static_cast(i)).name(); result_node->set_friendly_name(onnx_output_name + "/sink_port_0"); const auto& previous_operation = result_node->get_input_node_shared_ptr(0); previous_operation->set_friendly_name(onnx_output_name); } - return function; + return model; } -std::shared_ptr Graph::decode() { +std::shared_ptr Graph::decode() { decode_to_framework_nodes(); - auto function = create_function(); + auto function = create_model(); auto& rt_info = function->get_rt_info(); rt_info[ONNX_GRAPH_RT_ATTRIBUTE] = shared_from_this(); return function; @@ -486,9 +485,9 @@ Output Subgraph::get_ov_node_from_cache(const std::string& name) { return new_param; } -std::shared_ptr Subgraph::convert() { +std::shared_ptr Subgraph::convert() { convert_to_ov_nodes(); - return create_function(); + return create_model(); } const std::vector> Subgraph::get_inputs_from_parent() const { diff --git a/src/frontends/onnx/frontend/src/core/graph.hpp b/src/frontends/onnx/frontend/src/core/graph.hpp index bccde080ad1339..f11f0936f5dadb 100644 --- a/src/frontends/onnx/frontend/src/core/graph.hpp +++ b/src/frontends/onnx/frontend/src/core/graph.hpp @@ -34,8 +34,8 @@ class Graph : public std::enable_shared_from_this { Graph& operator=(const Graph&) = delete; Graph& operator=(Graph&&) = default; - std::shared_ptr decode(); - virtual std::shared_ptr convert(); + std::shared_ptr decode(); + virtual std::shared_ptr convert(); OutputVector get_ov_outputs(); const std::string& get_name() const { return m_model->get_graph().name(); @@ -80,7 +80,7 @@ class Graph : public std::enable_shared_from_this { void convert_to_ov_nodes(); void remove_dangling_parameters(); void set_metadata(std::shared_ptr& model) const; - std::shared_ptr create_function(); + std::shared_ptr create_model(); ParameterVector m_parameters; std::unique_ptr m_model; @@ -111,7 +111,7 @@ class Subgraph : public Graph { /// \return Vector of edge nodes from parent scope. const std::vector> get_inputs_from_parent() const; - std::shared_ptr convert() override; + std::shared_ptr convert() override; Subgraph() = delete; diff --git a/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp b/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp index c8818e98114580..eb70a82ea08e16 100644 --- a/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp +++ b/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp @@ -8,8 +8,8 @@ #include -#include "ngraph/shape.hpp" -#include "ngraph/type/element_type.hpp" +#include "openvino/core/shape.hpp" +#include "openvino/core/type/element_type.hpp" #include "tensor.hpp" namespace ngraph { @@ -26,7 +26,7 @@ class SparseTensor { if (m_shape == Shape{0}) { // It's possible to construct a sparse tensor in ONNX with "dims: 0" property // Such tensor contains a scalar. This results in a Shape{0} stored in m_shape. - // In nGraph a scalar is represented with Shape{} and thus this replacement. + // In OpenVINO a scalar is represented with Shape{} and thus this replacement. m_shape = Shape{}; } } diff --git a/src/frontends/onnx/frontend/src/core/transform.hpp b/src/frontends/onnx/frontend/src/core/transform.hpp index c061b7ab88de80..9d8fd4b8c081f1 100644 --- a/src/frontends/onnx/frontend/src/core/transform.hpp +++ b/src/frontends/onnx/frontend/src/core/transform.hpp @@ -48,7 +48,7 @@ static const std::vector legacy_ops_to_fixup = {"DeformableConv2D", /// Some legacy models use custom operators (listed in legacy_ops_to_fixup vector) which /// were registered in the default ONNX domain. This function updates nodes with these /// operations to use OPENVINO_ONNX_DOMAIN in order to process them correctly -/// in the nGraph ONNX Importer. +/// in the OpenVINO ONNX Frontend. /// /// \param model_proto Protobuf message with ONNX model to transform. void fixup_legacy_operators(ONNX_NAMESPACE::ModelProto& model_proto); diff --git a/src/frontends/onnx/frontend/src/core/value_info.hpp b/src/frontends/onnx/frontend/src/core/value_info.hpp index 99ac5b3bca3dba..5004064c425fd3 100644 --- a/src/frontends/onnx/frontend/src/core/value_info.hpp +++ b/src/frontends/onnx/frontend/src/core/value_info.hpp @@ -7,17 +7,16 @@ #include #include "core/tensor.hpp" -#include "default_opset.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/op/parameter.hpp" -#include "ngraph/partial_shape.hpp" -#include "ngraph/type/element_type.hpp" #include "onnx_common/utils.hpp" #include "onnx_import/core/node.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/parameter.hpp" #include "utils/common.hpp" using namespace ov::frontend::onnx::common; +using namespace ov::op; + namespace ngraph { namespace onnx_import { class ValueInfo { @@ -49,7 +48,7 @@ class ValueInfo { if (m_value_info_proto->type().tensor_type().has_elem_type()) { return common::get_ov_element_type(m_value_info_proto->type().tensor_type().elem_type()); } - return ngraph::element::dynamic; + return ov::element::dynamic; } std::shared_ptr get_ov_node(ParameterVector& parameters, @@ -63,14 +62,14 @@ class ValueInfo { } protected: - std::shared_ptr get_ov_parameter() const { - auto parameter = std::make_shared(get_element_type(), get_shape()); + std::shared_ptr get_ov_parameter() const { + auto parameter = std::make_shared(get_element_type(), get_shape()); parameter->set_friendly_name(get_name()); parameter->get_output_tensor(0).set_names({get_name()}); return parameter; } - std::shared_ptr get_ov_constant(const Tensor& tensor) const { + std::shared_ptr get_ov_constant(const Tensor& tensor) const { return tensor.get_ov_constant(); } diff --git a/src/frontends/onnx/frontend/src/edge_mapper.cpp b/src/frontends/onnx/frontend/src/edge_mapper.cpp index 8d81ba4361f562..22e1fb4b8bc009 100644 --- a/src/frontends/onnx/frontend/src/edge_mapper.cpp +++ b/src/frontends/onnx/frontend/src/edge_mapper.cpp @@ -8,7 +8,7 @@ #include -#include "ngraph/except.hpp" +#include "openvino/core/except.hpp" #include "openvino/frontend/exception.hpp" using namespace ov; diff --git a/src/frontends/onnx/frontend/src/edge_mapper.hpp b/src/frontends/onnx/frontend/src/edge_mapper.hpp index 11e1f76deae1a5..b4b4d846337bbb 100644 --- a/src/frontends/onnx/frontend/src/edge_mapper.hpp +++ b/src/frontends/onnx/frontend/src/edge_mapper.hpp @@ -39,8 +39,8 @@ class EdgeMapper { /// In such a case the algorthim tries to match the given node name /// with the input name (providing an input index is not enough). /// If a unique edge is found, it will be returned. - /// If InputEdge cannot be determined based on parameter values an ngraph_error - /// exception will be thrown. + /// If InputEdge cannot be determined based on parameter values an + /// ov:Exception will be thrown. /// /// \param node An EditorNode helper structure created based on a node name /// or a node output name. @@ -56,8 +56,8 @@ class EdgeMapper { /// In such a case the algorthim will try to match the given node name /// with the output name (providing an output index is not enough). /// If after such operation a found edge is unique, it is returned. - /// If OutputEdge cannot be determined based on given params the ngraph_error - /// exception is thrown. + /// If OutputEdge cannot be determined based on given params an + /// ov::Exception is thrown. /// /// \param node An EditorNode helper structure created based on a node name /// or a node output name. diff --git a/src/frontends/onnx/frontend/src/editor.cpp b/src/frontends/onnx/frontend/src/editor.cpp index 0ea9b1455f0ded..906675a0e4998a 100644 --- a/src/frontends/onnx/frontend/src/editor.cpp +++ b/src/frontends/onnx/frontend/src/editor.cpp @@ -22,7 +22,7 @@ using namespace ov; using namespace ov::onnx_editor; using namespace ov::frontend::onnx::common; -NGRAPH_SUPPRESS_DEPRECATED_START +OPENVINO_SUPPRESS_DEPRECATED_START namespace { using namespace ONNX_NAMESPACE; @@ -97,7 +97,7 @@ void add_dim_to_onnx_shape(const Dimension& dim, ONNX_NAMESPACE::TensorShapeProt if (dim.is_static()) { new_dim->set_dim_value(dim.get_length()); } else { - // nGraph Dimension is also considered dynamic if it represents a constrained range + // Dimension is also considered dynamic if it represents a constrained range // of allowed values as well as if it's unconstrained at all. ONNX cannot represent // ranged dimensions so this might not be 100% accurate. The modified ONNX model will // always have a fully dynamic dimension in this case. @@ -140,7 +140,7 @@ std::string extract_name(const T& input_or_initializer) { void modify_initializer(TensorProto& initializer, const std::string& name, - const std::shared_ptr values, + const std::shared_ptr values, ValueInfoProto* input) { const auto elem_type = values->get_element_type(); OPENVINO_ASSERT(is_supported_ov_type(elem_type), @@ -392,7 +392,7 @@ element::Type_t onnx_editor::ONNXModelEditor::get_input_type(const std::string& return ngraph::onnx_import::common::get_ov_element_type(type); } -void onnx_editor::ONNXModelEditor::set_input_shapes(const std::map& input_shapes) { +void onnx_editor::ONNXModelEditor::set_input_shapes(const std::map& input_shapes) { auto* onnx_graph = m_pimpl->m_model_proto->mutable_graph(); for (const auto& input_desc : input_shapes) { @@ -540,7 +540,7 @@ std::shared_ptr onnx_editor::ONNXModelEditor::get_function() const { } void onnx_editor::ONNXModelEditor::set_input_values( - const std::map>& input_values) { + const std::map>& input_values) { auto onnx_graph = m_pimpl->m_model_proto->mutable_graph(); for (const auto& input : input_values) { diff --git a/src/frontends/onnx/frontend/src/editor.hpp b/src/frontends/onnx/frontend/src/editor.hpp index 3edb098e77291c..1a6a5faf60c6a6 100644 --- a/src/frontends/onnx/frontend/src/editor.hpp +++ b/src/frontends/onnx/frontend/src/editor.hpp @@ -9,15 +9,13 @@ #include #include "editor_types.hpp" -#include "ngraph/deprecated.hpp" -#include "ngraph/function.hpp" -#include "ngraph/op/constant.hpp" -#include "ngraph/partial_shape.hpp" -#include "ngraph/type/element_type.hpp" #include "onnx_import/onnx_importer_visibility.hpp" +#include "openvino/core/deprecated.hpp" +#include "openvino/core/model.hpp" #include "openvino/frontend/extension/holder.hpp" #include "openvino/frontend/extension/progress_reporter.hpp" #include "openvino/frontend/extension/telemetry.hpp" +#include "openvino/op/constant.hpp" #include "utils/tensor_external_data.hpp" namespace ov { @@ -25,7 +23,7 @@ namespace onnx_editor { /// \brief A class representing a set of utilities allowing modification of an ONNX model /// /// \note This class can be used to modify an ONNX model before it gets translated to -/// an ngraph::Function by the import_onnx_model function. It lets you modify the +/// an ov::Model by the frontend->convert method. It lets you modify the /// model's input types and shapes, extract a subgraph and more. class ONNX_IMPORTER_API ONNXModelEditor final { public: @@ -73,7 +71,7 @@ class ONNX_IMPORTER_API ONNXModelEditor final { /// be used to modified the ONNX model loaded from a file. This /// method throws an exception if the model doesn't contain any of /// the inputs specified in its parameter. - void set_input_shapes(const std::map& input_shapes); + void set_input_shapes(const std::map& input_shapes); /// \brief Get shape of ONNX tensor indicated by the tensor_name. /// @@ -109,7 +107,7 @@ class ONNX_IMPORTER_API ONNXModelEditor final { /// \param input_values A collection of pairs {input_name: new_input_values} used to /// update the ONNX model. Initializers already existing are /// overwritten. - void set_input_values(const std::map>& input_values); + void set_input_values(const std::map>& input_values); /// \brief Changes the name of given tensor. /// @@ -154,7 +152,7 @@ class ONNX_IMPORTER_API ONNXModelEditor final { /// \brief Returns a serialized ONNX model, possibly modified by the editor. std::string model_string() const; - /// \brief Converts an edited ONNX model to an nGraph Function representation. + /// \brief Converts an edited ONNX model to an OpenVINO Model representation. std::shared_ptr get_function() const; /// \brief Returns a list of all inputs of the in-memory model. @@ -204,8 +202,8 @@ class ONNX_IMPORTER_API ONNXModelEditor final { /// In such a case the algorthim tries to match the given node name /// with the input name (providing an input index is not enough). /// If a unique edge is found, it will be returned. - /// If InputEdge cannot be determined based on parameter values an ngraph_error - /// exception will be thrown. + /// If InputEdge cannot be determined based on parameter values an ov::Exception + /// will be thrown. /// /// \param node A node helper structure created based on a node name /// or a node output name. @@ -221,8 +219,8 @@ class ONNX_IMPORTER_API ONNXModelEditor final { /// In such a case the algorthim will try to match the given node name /// with the output name (providing an output index is not enough). /// If after such operation a found edge is unique, it is returned. - /// If OutputEdge cannot be determined based on given params the ngraph_error - /// exception is thrown. + /// If OutputEdge cannot be determined based on given params the ov::Exception + /// will be thrown. /// /// \param node A node helper structure created based on a node name /// or a node output name. @@ -287,7 +285,7 @@ class ONNX_IMPORTER_API ONNXModelEditor final { /// std::vector get_output_ports(const EditorNode& node) const; - /// \brief Returns a nGraph function based on edited model + /// \brief Returns a OpenVINO Model based on edited model /// decoded to framework nodes /// std::shared_ptr decode(); diff --git a/src/frontends/onnx/frontend/src/input_model.cpp b/src/frontends/onnx/frontend/src/input_model.cpp index b4cb7c168da1e6..e43b1b0bb301a4 100644 --- a/src/frontends/onnx/frontend/src/input_model.cpp +++ b/src/frontends/onnx/frontend/src/input_model.cpp @@ -404,15 +404,15 @@ void InputModel::cut_and_add_new_input(const ov::frontend::Place::Ptr& place, co } void InputModel::set_tensor_value(const ov::frontend::Place::Ptr& place, const void* value) { - std::map> map; + std::map> map; if (const auto var_place = std::dynamic_pointer_cast(place)) { auto name = place->get_names().at(0); auto p_shape = m_editor->get_tensor_shape(name); auto el_type = m_editor->get_input_type(name); - std::shared_ptr constant = - ngraph::op::Constant::create(el_type, p_shape.to_shape(), value); + std::shared_ptr constant = + ov::op::v0::Constant::create(el_type, p_shape.to_shape(), value); constant->set_friendly_name(name); map.emplace(name, constant); diff --git a/src/frontends/onnx/frontend/src/op/conv_integer.cpp b/src/frontends/onnx/frontend/src/op/conv_integer.cpp index ad01ea55f39aeb..4f6c2b057c3d43 100644 --- a/src/frontends/onnx/frontend/src/op/conv_integer.cpp +++ b/src/frontends/onnx/frontend/src/op/conv_integer.cpp @@ -4,35 +4,41 @@ #include "op/conv_integer.hpp" -#include "default_opset.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/range.hpp" +#include "openvino/op/shape_of.hpp" +#include "openvino/op/subtract.hpp" +#include "openvino/op/unsqueeze.hpp" #include "utils/conv_factory.hpp" #include "utils/convpool.hpp" #include "utils/reshape.hpp" +using namespace ov::op; + OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { namespace onnx_import { namespace { -std::shared_ptr get_filter_zero_point(const OutputVector& inputs) { +std::shared_ptr get_filter_zero_point(const OutputVector& inputs) { const auto& original_zero_point = - (inputs.size() > 3) ? inputs.at(3) : ngraph::op::Constant::create(ngraph::element::i32, {}, {0}); + (inputs.size() > 3) ? inputs.at(3) : v0::Constant::create(ov::element::i32, {}, {0}); const auto filter_zero_point_rank = original_zero_point.get_partial_shape().rank(); if (filter_zero_point_rank.is_static() && filter_zero_point_rank.get_length() == 0) { - return std::make_shared(original_zero_point, element::i32); + return std::make_shared(original_zero_point, element::i32); } else { // in case of 1D zero point filter, it has to be unsqueezed to match the data input's rank - const auto& converted_filter_zero_point = - std::make_shared(original_zero_point, element::i32); - const auto& input_shape = std::make_shared(inputs.at(0), element::i32); - const auto& input_rank = std::make_shared(input_shape, element::i32); + const auto& converted_filter_zero_point = std::make_shared(original_zero_point, element::i32); + const auto& input_shape = std::make_shared(inputs.at(0), element::i32); + const auto& input_rank = std::make_shared(input_shape, element::i32); const auto& input_rank_scalar = reshape::interpret_as_scalar(input_rank); - const auto& one_node = ngraph::op::Constant::create(ngraph::element::i32, {}, {1}); + const auto& one_node = v0::Constant::create(ov::element::i32, {}, {1}); const auto& missing_dimensions = - std::make_shared(one_node, input_rank_scalar, one_node, element::i32); + std::make_shared(one_node, input_rank_scalar, one_node, element::i32); - return std::make_shared(converted_filter_zero_point, missing_dimensions); + return std::make_shared(converted_filter_zero_point, missing_dimensions); } } } // namespace @@ -44,23 +50,22 @@ OutputVector conv_integer(const Node& node) { const auto& input = inputs.at(0); const auto& filter = inputs.at(1); - const auto& input_zero_point = - (inputs.size() > 2) ? inputs.at(2) : ngraph::op::Constant::create(ngraph::element::i32, {}, {0}); + const auto& input_zero_point = (inputs.size() > 2) ? inputs.at(2) : v0::Constant::create(ov::element::i32, {}, {0}); - const auto& converted_input = std::make_shared(input, element::i32); - const auto& converted_filter = std::make_shared(filter, element::i32); + const auto& converted_input = std::make_shared(input, element::i32); + const auto& converted_filter = std::make_shared(filter, element::i32); - const auto& converted_input_zero_point = std::make_shared(input_zero_point, element::i32); + const auto& converted_input_zero_point = std::make_shared(input_zero_point, element::i32); const auto& filter_zero_point = get_filter_zero_point(inputs); - const auto& shifted_input = std::make_shared(converted_input, converted_input_zero_point); - const auto& shifted_filter = std::make_shared(converted_filter, filter_zero_point); + const auto& shifted_input = std::make_shared(converted_input, converted_input_zero_point); + const auto& shifted_filter = std::make_shared(converted_filter, filter_zero_point); const auto& groups = node.get_attribute_value("group", 1); const auto& strides = convpool::get_strides(node); const auto& dilations = convpool::get_dilations(node); const auto& paddings = convpool::get_pads(node); - const ngraph::op::PadType& auto_pad_type = convpool::get_auto_pad(node); + const ov::op::PadType& auto_pad_type = convpool::get_auto_pad(node); const auto& padding_below = paddings.first; const auto& padding_above = paddings.second; diff --git a/src/frontends/onnx/frontend/src/op/conv_integer.hpp b/src/frontends/onnx/frontend/src/op/conv_integer.hpp index 4a933a224c3e5e..01cd9b505fec6a 100644 --- a/src/frontends/onnx/frontend/src/op/conv_integer.hpp +++ b/src/frontends/onnx/frontend/src/op/conv_integer.hpp @@ -7,7 +7,6 @@ #include "openvino/core/deprecated.hpp" OPENVINO_SUPPRESS_DEPRECATED_START -#include "ngraph/node.hpp" #include "onnx_import/core/node.hpp" namespace ngraph { @@ -18,7 +17,7 @@ namespace set_1 { /// /// \param node The ONNX node object representing this operation. /// -/// \return The vector containing Ngraph nodes producing output of quantized ONNX +/// \return The vector containing OV nodes producing output of quantized ONNX /// convolution operation. OutputVector conv_integer(const Node& node); diff --git a/src/frontends/onnx/frontend/src/op/eye_like.cpp b/src/frontends/onnx/frontend/src/op/eye_like.cpp index 30bb9369d288ba..b617bda7f1d47a 100644 --- a/src/frontends/onnx/frontend/src/op/eye_like.cpp +++ b/src/frontends/onnx/frontend/src/op/eye_like.cpp @@ -4,16 +4,15 @@ #include "op/eye_like.hpp" -#include - #include "exceptions.hpp" -#include "ngraph/output_vector.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/eye.hpp" #include "openvino/op/gather.hpp" #include "openvino/op/shape_of.hpp" #include "utils/common.hpp" +using namespace ov::op; + OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { namespace onnx_import { @@ -22,12 +21,10 @@ namespace detail { namespace { /// \brief Split a shape returned by a ShapeOf operation into two outputs: width and height. -OutputVector get_shape_width_and_height(const Output& shape) { - const auto axis = ngraph::op::Constant::create(ngraph::element::i64, {1}, {0}); - const auto height = - std::make_shared(shape, ngraph::op::Constant::create(ngraph::element::i64, {1}, {0}), axis); - const auto width = - std::make_shared(shape, ngraph::op::Constant::create(ngraph::element::i64, {1}, {1}), axis); +OutputVector get_shape_width_and_height(const Output& shape) { + const auto axis = v0::Constant::create(ov::element::i64, {1}, {0}); + const auto height = std::make_shared(shape, v0::Constant::create(ov::element::i64, {1}, {0}), axis); + const auto width = std::make_shared(shape, v0::Constant::create(ov::element::i64, {1}, {1}), axis); return {width, height}; } @@ -59,9 +56,9 @@ OutputVector eye_like(const Node& node) { const auto width = dims.at(0); const auto height = dims.at(1); const auto k = - ov::op::v0::Constant::create(ngraph::element::i64, {1}, {node.get_attribute_value("k", 0)}); + ov::op::v0::Constant::create(ov::element::i64, {1}, {node.get_attribute_value("k", 0)}); - const auto output = std::make_shared(height, width, k, target_type); + const auto output = std::make_shared(height, width, k, target_type); return {output}; } diff --git a/src/frontends/onnx/frontend/src/op/eye_like.hpp b/src/frontends/onnx/frontend/src/op/eye_like.hpp index 011495f1bac732..de3c5fa1d6b24d 100644 --- a/src/frontends/onnx/frontend/src/op/eye_like.hpp +++ b/src/frontends/onnx/frontend/src/op/eye_like.hpp @@ -7,7 +7,6 @@ #include "openvino/core/deprecated.hpp" OPENVINO_SUPPRESS_DEPRECATED_START -#include "ngraph/node.hpp" #include "onnx_import/core/node.hpp" namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/op/loop.cpp b/src/frontends/onnx/frontend/src/op/loop.cpp index 40dcb2ef103c9f..7cc7c16a3ee9a4 100644 --- a/src/frontends/onnx/frontend/src/op/loop.cpp +++ b/src/frontends/onnx/frontend/src/op/loop.cpp @@ -4,17 +4,18 @@ #include "op/loop.hpp" -#include -#include - #include "core/graph.hpp" -#include "default_opset.hpp" #include "exceptions.hpp" -#include "ngraph/function.hpp" -#include "ngraph/op/util/op_types.hpp" #include "onnx_import/core/null_node.hpp" +#include "openvino/core/model.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/loop.hpp" +#include "openvino/op/unsqueeze.hpp" +#include "openvino/op/util/op_types.hpp" #include "utils/reshape.hpp" +using namespace ov::op; + OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { namespace onnx_import { @@ -25,7 +26,7 @@ namespace { /// iterations. /// It allows to replace termination condition body output with /// Constant. -/// As a result ngraph Loop shape inference is able to handle more +/// As a result OV Loop shape inference is able to handle more /// cases. /// /// \param[in] cond_in boolean input to the loop body depicting loop termination condition @@ -33,7 +34,7 @@ namespace { /// \param[in] cond_out loop termination condition computed after each iteration /// /// \return true if termination condition is not modified during loop iterations, false otherwise. -bool is_termination_condition_always_true(const ngraph::Node* cond_in, const ngraph::Node* cond_out) { +bool is_termination_condition_always_true(const ov::Node* cond_in, const ov::Node* cond_out) { return cond_in == cond_out; } } // namespace @@ -55,25 +56,24 @@ OutputVector loop(const Node& node) { } // optional inputs - Output trip_count; + Output trip_count; // trip count skipped or has value max(int64_t) means infinitive loop if (ov::op::util::is_null(ng_inputs.at(0)) || - (ngraph::op::is_constant(ng_inputs.at(0).get_node_shared_ptr()) && - ov::as_type_ptr(ng_inputs.at(0).get_node_shared_ptr())->cast_vector()[0] == + (ov::op::util::is_constant(ng_inputs.at(0).get_node_shared_ptr()) && + ov::as_type_ptr(ng_inputs.at(0).get_node_shared_ptr())->cast_vector()[0] == std::numeric_limits::max())) { // -1 means infinite Loop - trip_count = ngraph::op::Constant::create(ngraph::element::i64, {1}, {-1}); + trip_count = v0::Constant::create(ov::element::i64, {1}, {-1}); } else { trip_count = ng_inputs.at(0); } - Output termination_cond; // true means that first interation should be run + Output termination_cond; // true means that first interation should be run if (ov::op::util::is_null(ng_inputs.at(1).get_node_shared_ptr())) // termination condition skipped { - termination_cond = ngraph::op::Constant::create(ngraph::element::boolean, {1}, {true}); - } else if (ngraph::op::is_constant(ng_inputs.at(1).get_node_shared_ptr()) && - ov::as_type_ptr(ng_inputs.at(1).get_node_shared_ptr()) - ->cast_vector()[0] == false) { + termination_cond = v0::Constant::create(ov::element::boolean, {1}, {true}); + } else if (ov::op::util::is_constant(ng_inputs.at(1).get_node_shared_ptr()) && + ov::as_type_ptr(ng_inputs.at(1).get_node_shared_ptr())->cast_vector()[0] == false) { // no iteration is performed so initial values are returned OutputVector node_outputs; // final values @@ -90,17 +90,17 @@ OutputVector loop(const Node& node) { } const int64_t concat_axis = 0; - const auto concat_axis_const = ngraph::op::Constant::create(ngraph::element::i64, {1}, {concat_axis}); + const auto concat_axis_const = v0::Constant::create(ov::element::i64, {1}, {concat_axis}); // add dimension along which scan outputs will be concatenated for (size_t i = loop_carried_dependencies.size() + 1; i < body_outputs.size(); ++i) { - body_outputs[i] = std::make_shared(body_outputs[i], concat_axis_const); + body_outputs[i] = std::make_shared(body_outputs[i], concat_axis_const); } const auto& cond_in = body_inputs[1]; const auto& cond_out = body_outputs[0]; // optimization allow to improve nG Loop shape inference if (is_termination_condition_always_true(cond_in.get(), cond_out.get_node())) { - body_outputs[0] = ngraph::op::Constant::create(ngraph::element::boolean, {1}, {true}); + body_outputs[0] = v0::Constant::create(ov::element::boolean, {1}, {true}); } CHECK_VALID_NODE(node, @@ -123,9 +123,9 @@ OutputVector loop(const Node& node) { ParameterVector body_params(body_inputs.begin() + 2, body_inputs.end()); body_params.emplace(body_params.begin(), body_inputs[0]); // current iteration body input - const auto body = std::make_shared(body_outputs, body_params); - auto loop = std::make_shared(trip_count, termination_cond); - default_opset::Loop::SpecialBodyPorts spec_ports{0, 0}; + const auto body = std::make_shared(body_outputs, body_params); + auto loop = std::make_shared(trip_count, termination_cond); + v5::Loop::SpecialBodyPorts spec_ports{0, 0}; loop->set_special_body_ports(spec_ports); loop->set_function(body); diff --git a/src/frontends/onnx/frontend/src/op/loop.hpp b/src/frontends/onnx/frontend/src/op/loop.hpp index 9e7af71c3daab4..d5a67533367b69 100644 --- a/src/frontends/onnx/frontend/src/op/loop.hpp +++ b/src/frontends/onnx/frontend/src/op/loop.hpp @@ -7,21 +7,20 @@ #include "openvino/core/deprecated.hpp" OPENVINO_SUPPRESS_DEPRECATED_START -#include "ngraph/node.hpp" #include "onnx_import/core/node.hpp" namespace ngraph { namespace onnx_import { namespace op { namespace set_1 { -/// \brief Creates nGraph node representing ONNX loop operator. +/// \brief Creates OV node representing ONNX loop operator. /// /// \note Details available here: /// https://github.com/onnx/onnx/blob/master/docs/Operators.md#Loop /// /// \param[in] node The input ONNX node representing this operation. /// -/// \return Vector of nodes containting resulting nGraph nodes. +/// \return Vector of nodes containting resulting OV nodes. /// OutputVector loop(const Node& node); } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/matmul_integer.cpp b/src/frontends/onnx/frontend/src/op/matmul_integer.cpp index 26f0100c92e171..a467b4cc82b452 100644 --- a/src/frontends/onnx/frontend/src/op/matmul_integer.cpp +++ b/src/frontends/onnx/frontend/src/op/matmul_integer.cpp @@ -4,11 +4,13 @@ #include "op/matmul_integer.hpp" -#include -#include -#include +#include "openvino/op/constant.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/matmul.hpp" +#include "openvino/op/subtract.hpp" +#include "openvino/op/unsqueeze.hpp" -#include "default_opset.hpp" +using namespace ov::op; OPENVINO_SUPPRESS_DEPRECATED_START namespace ngraph { @@ -20,33 +22,30 @@ OutputVector matmul_integer(const Node& node) { const auto& A = inputs.at(0); const auto& B = inputs.at(1); - const auto& A_zero_point = - (inputs.size() > 2) ? inputs.at(2) : ngraph::op::Constant::create(ngraph::element::i32, {1}, {0}); - const auto& B_zero_point = - (inputs.size() > 3) ? inputs.at(3) : ngraph::op::Constant::create(ngraph::element::i32, {1}, {0}); + const auto& A_zero_point = (inputs.size() > 2) ? inputs.at(2) : v0::Constant::create(ov::element::i32, {1}, {0}); + const auto& B_zero_point = (inputs.size() > 3) ? inputs.at(3) : v0::Constant::create(ov::element::i32, {1}, {0}); - const auto& converted_A = std::make_shared(A, element::i32); - const auto& converted_B = std::make_shared(B, element::i32); + const auto& converted_A = std::make_shared(A, element::i32); + const auto& converted_B = std::make_shared(B, element::i32); - const auto& converted_A_zero_point = std::make_shared(A_zero_point, element::i32); - const auto& converted_B_zero_point = std::make_shared(B_zero_point, element::i32); + const auto& converted_A_zero_point = std::make_shared(A_zero_point, element::i32); + const auto& converted_B_zero_point = std::make_shared(B_zero_point, element::i32); const auto& A_zero_point_rank = A_zero_point.get_partial_shape().rank(); - Output shifted_A; + Output shifted_A; if (A_zero_point_rank.is_static() && A_zero_point_rank.get_length() == 1) { - const auto& one_node = ngraph::op::Constant::create(ngraph::element::i32, {1}, {1}); - const auto& reshaped_A_zero_point = - std::make_shared(converted_A_zero_point, one_node); + const auto& one_node = v0::Constant::create(ov::element::i32, {1}, {1}); + const auto& reshaped_A_zero_point = std::make_shared(converted_A_zero_point, one_node); - shifted_A = std::make_shared(converted_A, reshaped_A_zero_point); + shifted_A = std::make_shared(converted_A, reshaped_A_zero_point); } else { - shifted_A = std::make_shared(converted_A, converted_A_zero_point); + shifted_A = std::make_shared(converted_A, converted_A_zero_point); } - const auto& shifted_B = std::make_shared(converted_B, converted_B_zero_point); + const auto& shifted_B = std::make_shared(converted_B, converted_B_zero_point); - const auto& result = std::make_shared(shifted_A, shifted_B); + const auto& result = std::make_shared(shifted_A, shifted_B); return {result}; } diff --git a/src/frontends/onnx/frontend/src/op/matmul_integer.hpp b/src/frontends/onnx/frontend/src/op/matmul_integer.hpp index 3da61339848ca6..3bb07670c5778c 100644 --- a/src/frontends/onnx/frontend/src/op/matmul_integer.hpp +++ b/src/frontends/onnx/frontend/src/op/matmul_integer.hpp @@ -7,7 +7,6 @@ #include "openvino/core/deprecated.hpp" OPENVINO_SUPPRESS_DEPRECATED_START -#include "ngraph/node.hpp" #include "onnx_import/core/node.hpp" namespace ngraph { @@ -18,7 +17,7 @@ namespace set_1 { /// /// \param node The ONNX node object representing this operation. /// -/// \return The vector containing Ngraph nodes producing output of ONNX quantizied +/// \return The vector containing OV nodes producing output of ONNX quantizied /// matrix multiplication integer operation. OutputVector matmul_integer(const Node& node); } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/ops_bridge.hpp b/src/frontends/onnx/frontend/src/ops_bridge.hpp index 7cbc25f302b196..2618260bf9129e 100644 --- a/src/frontends/onnx/frontend/src/ops_bridge.hpp +++ b/src/frontends/onnx/frontend/src/ops_bridge.hpp @@ -13,7 +13,6 @@ #include "onnx_import/core/operator_set.hpp" #include "openvino/core/deprecated.hpp" -#include "openvino/core/except.hpp" #include "version_range.hpp" namespace ngraph { diff --git a/src/frontends/onnx/frontend/src/utils/common.cpp b/src/frontends/onnx/frontend/src/utils/common.cpp index aeda69b6063f58..206f0b0325127f 100644 --- a/src/frontends/onnx/frontend/src/utils/common.cpp +++ b/src/frontends/onnx/frontend/src/utils/common.cpp @@ -6,7 +6,6 @@ #include // onnx types -#include "ngraph/graph_util.hpp" #include "onnx_framework_node.hpp" #include "openvino/core/deprecated.hpp" #include "openvino/frontend/exception.hpp" diff --git a/src/frontends/onnx/frontend/src/utils/conv_factory.cpp b/src/frontends/onnx/frontend/src/utils/conv_factory.cpp index 6cd180b6ecc64f..da42025c29bbd4 100644 --- a/src/frontends/onnx/frontend/src/utils/conv_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/conv_factory.cpp @@ -4,7 +4,6 @@ #include "utils/conv_factory.hpp" -#include "default_opset.hpp" #include "exceptions.hpp" #include "onnx_import/core/null_node.hpp" #include "openvino/op/group_conv.hpp" diff --git a/src/frontends/onnx/frontend/src/utils/convpool.hpp b/src/frontends/onnx/frontend/src/utils/convpool.hpp index 36d880abcbffe9..e275271918ff2a 100644 --- a/src/frontends/onnx/frontend/src/utils/convpool.hpp +++ b/src/frontends/onnx/frontend/src/utils/convpool.hpp @@ -4,7 +4,6 @@ #pragma once -#include "ngraph/coordinate_diff.hpp" #include "onnx_import/core/node.hpp" #include "openvino/core/deprecated.hpp" #include "openvino/core/shape.hpp" diff --git a/src/frontends/onnx/frontend/src/utils/reshape.hpp b/src/frontends/onnx/frontend/src/utils/reshape.hpp index e40c119a7ce7e3..57d76d08823f29 100644 --- a/src/frontends/onnx/frontend/src/utils/reshape.hpp +++ b/src/frontends/onnx/frontend/src/utils/reshape.hpp @@ -9,8 +9,7 @@ #include #include -#include "ngraph/axis_vector.hpp" -#include "ngraph/node.hpp" +#include "openvino/core/node.hpp" namespace ngraph { namespace onnx_import { @@ -44,7 +43,7 @@ std::vector infer_dimensions(const std::string& node_name, /// /// \return Original node or a node representing a reshape of the original. /// -Output interpret_as_scalar(const Output& node); +Output interpret_as_scalar(const Output& node); /// \brief Reshape node from shape {C} to {1, C, 1, 1,...} /// @@ -58,8 +57,8 @@ Output interpret_as_scalar(const Output& node); /// /// \return Original node or a node representing a reshape of the original. /// -Output reshape_channel_shaped_node_to_nchw(const Output& node, - const Output& expected_rank); +Output reshape_channel_shaped_node_to_nchw(const Output& node, + const Output& expected_rank); } // namespace reshape } // namespace onnx_import diff --git a/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp b/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp index 96dd0a4e0380f5..d96f354c65e1c5 100644 --- a/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp +++ b/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp @@ -58,9 +58,7 @@ Buffer TensorExternalData::load_external_mmap_data(const std:: Buffer TensorExternalData::load_external_data(const std::string& model_dir) const { auto full_path = ov::util::path_join({model_dir, m_data_location}); #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) - NGRAPH_SUPPRESS_DEPRECATED_START ov::util::convert_path_win_style(full_path); - NGRAPH_SUPPRESS_DEPRECATED_END std::ifstream external_data_stream(ov::util::string_to_wstring(full_path).c_str(), std::ios::binary | std::ios::in | std::ios::ate); #else diff --git a/src/frontends/onnx/frontend/src/utils/variadic.hpp b/src/frontends/onnx/frontend/src/utils/variadic.hpp index fe48ea92b34938..50e8a5ebadcff5 100644 --- a/src/frontends/onnx/frontend/src/utils/variadic.hpp +++ b/src/frontends/onnx/frontend/src/utils/variadic.hpp @@ -6,10 +6,6 @@ #include -#include "ngraph/coordinate_diff.hpp" -#include "ngraph/node.hpp" -#include "ngraph/op/add.hpp" -#include "ngraph/shape.hpp" #include "onnx_import/core/node.hpp" #include "openvino/core/deprecated.hpp" #include "utils/common.hpp" @@ -17,24 +13,23 @@ namespace ngraph { namespace onnx_import { namespace variadic { -/// \brief Create an nGraph version of an ONNX variadic operation. +/// \brief Create an OpenVINO version of an ONNX variadic operation. /// This creates a subgraph with a series of binary operations. /// /// \param node Incoming ONNX opearation. /// -/// \tparam T Class of an nGraph binary operation (e.g. Add, Minimum, Maximum) +/// \tparam T Class of an OpenVINO binary operation (e.g. Add, Minimum, Maximum) /// -/// \return nGraph node equivalent of the ONNX operation +/// \return OpenVINO node equivalent of the ONNX operation OPENVINO_SUPPRESS_DEPRECATED_START template inline OutputVector make_ng_variadic_op( const Node& node, - const ngraph::op::AutoBroadcastSpec& auto_broadcast = ngraph::op::AutoBroadcastType::NUMPY) { + const ov::op::AutoBroadcastSpec& auto_broadcast = ov::op::AutoBroadcastType::NUMPY) { const OutputVector ng_inputs{node.get_ng_inputs()}; // Templated binary operation - Creates Add, Minimum, Maximum, etc. - const auto binary_operation = [&auto_broadcast](const Output& arg0, - const Output& arg1) { + const auto binary_operation = [&auto_broadcast](const Output& arg0, const Output& arg1) { return std::make_shared(arg0, arg1, auto_broadcast); };