diff --git a/src/frontends/onnx/frontend/include/openvino/frontend/onnx/node_context.hpp b/src/frontends/onnx/frontend/include/openvino/frontend/onnx/node_context.hpp index 0aa11b50d4a237..b6dac7caf9a10b 100644 --- a/src/frontends/onnx/frontend/include/openvino/frontend/onnx/node_context.hpp +++ b/src/frontends/onnx/frontend/include/openvino/frontend/onnx/node_context.hpp @@ -4,26 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" #include "openvino/frontend/extension/conversion.hpp" #include "openvino/frontend/node_context.hpp" #include "openvino/frontend/onnx/visibility.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { -class Node; -} -} // namespace ngraph - namespace ov { namespace frontend { namespace onnx { +class Node; class ONNX_FRONTEND_API NodeContext : public ov::frontend::NodeContext { public: using Ptr = std::shared_ptr; - explicit NodeContext(const ngraph::onnx_import::Node& context); + explicit NodeContext(const ov::frontend::onnx::Node& context); size_t get_input_size() const override; Output get_input(int port_idx) const override; @@ -31,14 +24,13 @@ class ONNX_FRONTEND_API NodeContext : public ov::frontend::NodeContext { ov::Any get_attribute_as_any(const std::string& name) const override; protected: - const ngraph::onnx_import::Node& m_context; + const ov::frontend::onnx::Node& m_context; ov::OutputVector m_inputs; private: ov::Any apply_additional_conversion_rules(const ov::Any& data, const std::type_info& type_info) const override; }; -using CreatorFunction = std::function; +using CreatorFunction = std::function; } // namespace onnx } // namespace frontend } // namespace ov -OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/onnx/frontend/src/core/attribute.cpp b/src/frontends/onnx/frontend/src/core/attribute.cpp index 0f3ff1736e9a0e..5f4667acdba4b7 100644 --- a/src/frontends/onnx/frontend/src/core/attribute.cpp +++ b/src/frontends/onnx/frontend/src/core/attribute.cpp @@ -7,14 +7,15 @@ #include "core/graph.hpp" #include "core/model.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { Subgraph Attribute::get_subgraph(Graph* parent_graph) const { - if (m_attribute_proto->type() != ONNX_NAMESPACE::AttributeProto_AttributeType_GRAPH) { + if (m_attribute_proto->type() != AttributeProto_AttributeType::AttributeProto_AttributeType_GRAPH) { ONNX_INVALID_ATTR(m_attribute_proto->type(), "GRAPH"); } - auto model_proto = std::make_shared(); + auto model_proto = std::make_shared(); const auto& graph = m_attribute_proto->g(); model_proto->mutable_graph()->CopyFrom(graph); @@ -69,6 +70,6 @@ ov::Any Attribute::get_any() const { } } -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/attribute.hpp b/src/frontends/onnx/frontend/src/core/attribute.hpp index ea8bedb5a28d0f..92708e27a8863e 100644 --- a/src/frontends/onnx/frontend/src/core/attribute.hpp +++ b/src/frontends/onnx/frontend/src/core/attribute.hpp @@ -10,39 +10,34 @@ #include "core/tensor.hpp" #include "openvino/core/except.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { // forward declarations class Graph; class Subgraph; class Model; -// Detecting automatically the underlying type used to store the information -// for data type of values an attribute is holding. A bug was discovered in -// protobuf which forced ONNX team to switch from `enum AttributeProto_AttributeType` -// to `int32` in order to workaround the bug. This line allows using both versions -// of ONNX generated wrappers. -using AttributeProto_AttributeType = decltype(ONNX_NAMESPACE::AttributeProto{}.type()); +using ::ONNX_NAMESPACE::AttributeProto; +using ::ONNX_NAMESPACE::AttributeProto_AttributeType; +using ::ONNX_NAMESPACE::AttributeProto_AttributeType_Name; namespace detail { namespace attribute { template -inline T get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline T get_value(const AttributeProto& attribute) { OPENVINO_THROW("Unsupported attribute type"); } -#define ONNX_INVALID_ATTR(attr, expected) \ - OPENVINO_THROW("Invalid attribute type ", \ - ONNX_NAMESPACE::AttributeProto_AttributeType_Name(attr), \ - " expected: ", \ - expected) +#define ONNX_INVALID_ATTR(attr, expected) \ + OPENVINO_THROW("Invalid attribute type ", AttributeProto_AttributeType_Name(attr), " expected: ", expected) template <> -inline float get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline float get_value(const AttributeProto& attribute) { switch (attribute.type()) { - case ONNX_NAMESPACE::AttributeProto_AttributeType_INT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INT: return static_cast(attribute.i()); - case ONNX_NAMESPACE::AttributeProto_AttributeType_FLOAT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOAT: return attribute.f(); default: ONNX_INVALID_ATTR(attribute.type(), "INT, FLOAT"); @@ -50,15 +45,15 @@ inline float get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { } template <> -inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline std::vector get_value(const AttributeProto& attribute) { switch (attribute.type()) { - case ONNX_NAMESPACE::AttributeProto_AttributeType_INT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INT: return {static_cast(attribute.i())}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_INTS: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INTS: return {std::begin(attribute.floats()), std::end(attribute.floats())}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_FLOAT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOAT: return {attribute.f()}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_FLOATS: + case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOATS: return {std::begin(attribute.floats()), std::end(attribute.floats())}; default: ONNX_INVALID_ATTR(attribute.type(), "INT, INTS, FLOAT, FLOATS"); @@ -66,11 +61,11 @@ inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attrib } template <> -inline double get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline double get_value(const AttributeProto& attribute) { switch (attribute.type()) { - case ONNX_NAMESPACE::AttributeProto_AttributeType_FLOAT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOAT: return static_cast(attribute.f()); - case ONNX_NAMESPACE::AttributeProto_AttributeType_INT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INT: return static_cast(attribute.i()); default: ONNX_INVALID_ATTR(attribute.type(), "INT, FLOAT"); @@ -78,19 +73,19 @@ inline double get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { } template <> -inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline std::vector get_value(const AttributeProto& attribute) { #if defined(_MSC_VER) # pragma warning(push) # pragma warning(disable : 4244) #endif switch (attribute.type()) { - case ONNX_NAMESPACE::AttributeProto_AttributeType_INT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INT: return {static_cast(attribute.i())}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_INTS: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INTS: return {std::begin(attribute.ints()), std::end(attribute.ints())}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_FLOAT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOAT: return {static_cast(attribute.f())}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_FLOATS: + case AttributeProto_AttributeType::AttributeProto_AttributeType_FLOATS: return {std::begin(attribute.floats()), std::end(attribute.floats())}; default: ONNX_INVALID_ATTR(attribute.type(), "INT, INTS, FLOAT, FLOATS"); @@ -101,19 +96,19 @@ inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attri } template <> -inline std::size_t get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { - if (attribute.type() != ONNX_NAMESPACE::AttributeProto_AttributeType_INT) { +inline std::size_t get_value(const AttributeProto& attribute) { + if (attribute.type() != AttributeProto_AttributeType::AttributeProto_AttributeType_INT) { ONNX_INVALID_ATTR(attribute.type(), "INT"); } return static_cast(attribute.i()); } template <> -inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline std::vector get_value(const AttributeProto& attribute) { switch (attribute.type()) { - case ONNX_NAMESPACE::AttributeProto_AttributeType_INT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INT: return {static_cast(attribute.i())}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_INTS: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INTS: return {std::begin(attribute.ints()), std::end(attribute.ints())}; default: ONNX_INVALID_ATTR(attribute.type(), "INT, INTS"); @@ -121,19 +116,19 @@ inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& } template <> -inline int64_t get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { - if (attribute.type() != ONNX_NAMESPACE::AttributeProto_AttributeType_INT) { +inline int64_t get_value(const AttributeProto& attribute) { + if (attribute.type() != AttributeProto_AttributeType::AttributeProto_AttributeType_INT) { ONNX_INVALID_ATTR(attribute.type(), "INT"); } return attribute.i(); } template <> -inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline std::vector get_value(const AttributeProto& attribute) { switch (attribute.type()) { - case ONNX_NAMESPACE::AttributeProto_AttributeType_INT: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INT: return {attribute.i()}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_INTS: + case AttributeProto_AttributeType::AttributeProto_AttributeType_INTS: return {std::begin(attribute.ints()), std::end(attribute.ints())}; default: ONNX_INVALID_ATTR(attribute.type(), "INT, INTS"); @@ -141,19 +136,19 @@ inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attr } template <> -inline std::string get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { - if (attribute.type() != ONNX_NAMESPACE::AttributeProto_AttributeType_STRING) { +inline std::string get_value(const AttributeProto& attribute) { + if (attribute.type() != AttributeProto_AttributeType::AttributeProto_AttributeType_STRING) { ONNX_INVALID_ATTR(attribute.type(), "STRING"); } return attribute.s(); } template <> -inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& attribute) { +inline std::vector get_value(const AttributeProto& attribute) { switch (attribute.type()) { - case ONNX_NAMESPACE::AttributeProto_AttributeType_STRING: + case AttributeProto_AttributeType::AttributeProto_AttributeType_STRING: return {attribute.s()}; - case ONNX_NAMESPACE::AttributeProto_AttributeType_STRINGS: + case AttributeProto_AttributeType::AttributeProto_AttributeType_STRINGS: return {std::begin(attribute.strings()), std::end(attribute.strings())}; default: ONNX_INVALID_ATTR(attribute.type(), "STRING, STRINGS"); @@ -161,29 +156,28 @@ inline std::vector get_value(const ONNX_NAMESPACE::AttributeProto& } } // namespace attribute - } // namespace detail class Attribute { public: enum class Type { - undefined = ONNX_NAMESPACE::AttributeProto_AttributeType_UNDEFINED, - float_point = ONNX_NAMESPACE::AttributeProto_AttributeType_FLOAT, - integer = ONNX_NAMESPACE::AttributeProto_AttributeType_INT, - string = ONNX_NAMESPACE::AttributeProto_AttributeType_STRING, - tensor = ONNX_NAMESPACE::AttributeProto_AttributeType_TENSOR, - graph = ONNX_NAMESPACE::AttributeProto_AttributeType_GRAPH, - sparse_tensor = ONNX_NAMESPACE::AttributeProto_AttributeType_SPARSE_TENSOR, - float_point_array = ONNX_NAMESPACE::AttributeProto_AttributeType_FLOATS, - integer_array = ONNX_NAMESPACE::AttributeProto_AttributeType_INTS, - string_array = ONNX_NAMESPACE::AttributeProto_AttributeType_STRINGS, - tensor_array = ONNX_NAMESPACE::AttributeProto_AttributeType_TENSORS, - sparse_tensor_array = ONNX_NAMESPACE::AttributeProto_AttributeType_SPARSE_TENSORS, - graph_array = ONNX_NAMESPACE::AttributeProto_AttributeType_GRAPHS + undefined = AttributeProto_AttributeType::AttributeProto_AttributeType_UNDEFINED, + float_point = AttributeProto_AttributeType::AttributeProto_AttributeType_FLOAT, + integer = AttributeProto_AttributeType::AttributeProto_AttributeType_INT, + string = AttributeProto_AttributeType::AttributeProto_AttributeType_STRING, + tensor = AttributeProto_AttributeType::AttributeProto_AttributeType_TENSOR, + graph = AttributeProto_AttributeType::AttributeProto_AttributeType_GRAPH, + sparse_tensor = AttributeProto_AttributeType::AttributeProto_AttributeType_SPARSE_TENSOR, + float_point_array = AttributeProto_AttributeType::AttributeProto_AttributeType_FLOATS, + integer_array = AttributeProto_AttributeType::AttributeProto_AttributeType_INTS, + string_array = AttributeProto_AttributeType::AttributeProto_AttributeType_STRINGS, + tensor_array = AttributeProto_AttributeType::AttributeProto_AttributeType_TENSORS, + sparse_tensor_array = AttributeProto_AttributeType::AttributeProto_AttributeType_SPARSE_TENSORS, + graph_array = AttributeProto_AttributeType::AttributeProto_AttributeType_GRAPHS }; Attribute() = delete; - Attribute(const ONNX_NAMESPACE::AttributeProto& attribute_proto, + Attribute(const AttributeProto& attribute_proto, const std::string& model_dir, detail::MappedMemoryHandles mmap_cache) : m_attribute_proto{&attribute_proto}, @@ -285,7 +279,7 @@ class Attribute { return {std::begin(m_attribute_proto->strings()), std::end(m_attribute_proto->strings())}; } - /* explicit */ operator ONNX_NAMESPACE::AttributeProto_AttributeType() const { + /* explicit */ operator AttributeProto_AttributeType() const { return m_attribute_proto->type(); } @@ -337,11 +331,11 @@ class Attribute { ov::Any get_any() const; private: - const ONNX_NAMESPACE::AttributeProto* m_attribute_proto; + const AttributeProto* m_attribute_proto; std::string m_model_dir; detail::MappedMemoryHandles m_mmap_cache; }; -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/graph.cpp b/src/frontends/onnx/frontend/src/core/graph.cpp index e332c4c70c5ce9..f6d3ba3d9433bf 100644 --- a/src/frontends/onnx/frontend/src/core/graph.cpp +++ b/src/frontends/onnx/frontend/src/core/graph.cpp @@ -23,9 +23,11 @@ #include "utils/common.hpp" using namespace ov; +using namespace ::ONNX_NAMESPACE; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace detail { bool common_node_for_all_outputs(const ov::OutputVector& outputs) { const auto first_out_node = outputs.at(0).get_node(); @@ -37,7 +39,6 @@ bool common_node_for_all_outputs(const ov::OutputVector& outputs) { return ret; }; -OPENVINO_SUPPRESS_DEPRECATED_START OperatorsBridge register_extensions(OperatorsBridge& bridge, const std::vector& conversions) { for (const auto& extension : conversions) { @@ -45,35 +46,33 @@ OperatorsBridge register_extensions(OperatorsBridge& bridge, bridge.overwrite_operator( common_conv_ext->get_op_type(), "", - [common_conv_ext](const ngraph::onnx_import::Node& node) -> ov::OutputVector { + [common_conv_ext](const ov::frontend::onnx::Node& node) -> ov::OutputVector { return common_conv_ext->get_converter()(ov::frontend::onnx::NodeContext(node)); }); } else if (const auto onnx_conv_ext = std::dynamic_pointer_cast(extension)) { bridge.overwrite_operator(onnx_conv_ext->get_op_type(), onnx_conv_ext->get_domain(), - [onnx_conv_ext](const ngraph::onnx_import::Node& node) -> ov::OutputVector { + [onnx_conv_ext](const ov::frontend::onnx::Node& node) -> ov::OutputVector { return onnx_conv_ext->get_converter()(ov::frontend::onnx::NodeContext(node)); }); } } return bridge; } -OPENVINO_SUPPRESS_DEPRECATED_END OperatorsBridge init_ops_bridge(const std::vector& conversions) { OperatorsBridge bridge; return register_extensions(bridge, conversions); } -Model::ModelOpSet build_model_opset(const ONNX_NAMESPACE::ModelProto& model_proto, const OperatorsBridge& ops_bridge) { +Model::ModelOpSet build_model_opset(const ModelProto& model_proto, const OperatorsBridge& ops_bridge) { // copy the opset imports from the ONNX model and sort them by their version in ascending order // this will make sure that multiple opset imports for the same domain will cause the largest // version to be used for this model, for example: // [{domain:"", version:11}, {domain:"", version:1} {domain:"", version:13}] ==> {domain:"", version:13} auto opset_imports = model_proto.opset_import(); - const auto sort_by_version_ascending = [](const ONNX_NAMESPACE::OperatorSetIdProto& lhs, - const ONNX_NAMESPACE::OperatorSetIdProto& rhs) { + const auto sort_by_version_ascending = [](const OperatorSetIdProto& lhs, const OperatorSetIdProto& rhs) { return lhs.version() < rhs.version(); }; std::sort(std::begin(opset_imports), std::end(opset_imports), sort_by_version_ascending); @@ -81,7 +80,7 @@ Model::ModelOpSet build_model_opset(const ONNX_NAMESPACE::ModelProto& model_prot Model::ModelOpSet opset; std::for_each(opset_imports.rbegin(), opset_imports.rend(), - [&opset, &ops_bridge](const ONNX_NAMESPACE::OperatorSetIdProto& onnx_opset) { + [&opset, &ops_bridge](const OperatorSetIdProto& onnx_opset) { const auto domain = onnx_opset.has_domain() ? onnx_opset.domain() == "ai.onnx" ? "" : onnx_opset.domain() : ""; if (opset.find(domain) == std::end(opset)) { @@ -111,13 +110,13 @@ ov::frontend::ExtensionHolder subgraph_required_extensions( } // namespace detail Graph::Graph(const std::string& model_dir, - const std::shared_ptr& model_proto, + const std::shared_ptr& model_proto, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions) : Graph(model_dir, model_proto, common::make_unique(), mmap_cache, std::move(extensions)) {} Graph::Graph(const std::string& model_dir, - const std::shared_ptr& model_proto, + const std::shared_ptr& model_proto, std::unique_ptr&& cache, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions) @@ -144,7 +143,7 @@ Graph::Graph(const std::string& model_dir, // invalid external data makes initializers creation impossible throw; } catch (const ov::Exception&) { - ov_constant = ngraph::onnx_import::common::make_failsafe_constant(tensor.get_ov_type()); + ov_constant = ov::frontend::onnx::common::make_failsafe_constant(tensor.get_ov_type()); } initializers.emplace(initializer_tensor.name(), tensor); @@ -166,7 +165,6 @@ Graph::Graph(const std::string& model_dir, } } -OPENVINO_SUPPRESS_DEPRECATED_START void Graph::convert_to_ov_nodes() { const float total = static_cast(m_model->get_graph().node().size()); unsigned int completed = 0u; @@ -198,16 +196,14 @@ void Graph::convert_to_ov_nodes() { } } } -OPENVINO_SUPPRESS_DEPRECATED_END void Graph::remove_dangling_parameters() { - const auto any_tensor_name_matches_onnx_output = [](const Output& param_output, - const ONNX_NAMESPACE::GraphProto& graph) { + const auto any_tensor_name_matches_onnx_output = [](const Output& param_output, const GraphProto& graph) { const auto found_in_outputs = [&graph](const std::string& tensor_name) { const auto& graph_outputs = graph.output(); return std::any_of(std::begin(graph_outputs), std::end(graph_outputs), - [&tensor_name](const ONNX_NAMESPACE::ValueInfoProto& output) { + [&tensor_name](const ValueInfoProto& output) { return tensor_name == output.name(); }); }; @@ -245,9 +241,8 @@ std::shared_ptr Graph::convert() { return function; } -OPENVINO_SUPPRESS_DEPRECATED_START ov::OutputVector Graph::make_framework_nodes(const Node& onnx_node) { - std::shared_ptr framework_node; + std::shared_ptr framework_node; if (onnx_node.has_subgraphs()) { const auto& subgraphs = onnx_node.get_subgraphs(); auto inputs = onnx_node.get_ng_inputs(); @@ -264,9 +259,9 @@ ov::OutputVector Graph::make_framework_nodes(const Node& onnx_node) { } } } - framework_node = std::make_shared(onnx_node, models, inputs); + framework_node = std::make_shared(onnx_node, models, inputs); } else { - framework_node = std::make_shared(onnx_node); + framework_node = std::make_shared(onnx_node); } return framework_node->outputs(); } @@ -298,7 +293,6 @@ void Graph::decode_to_framework_nodes() { } } } -OPENVINO_SUPPRESS_DEPRECATED_END std::shared_ptr Graph::create_model() { auto model = std::make_shared(get_ov_outputs(), m_parameters, get_name()); @@ -329,7 +323,6 @@ Output Graph::get_ov_node_from_cache(const std::string& name) { return m_cache->get_node(name); } -OPENVINO_SUPPRESS_DEPRECATED_START ov::OutputVector Graph::get_ov_outputs() { ov::OutputVector results; for (const auto& output : m_model->get_graph().output()) { @@ -349,7 +342,7 @@ ov::OutputVector Graph::make_ov_nodes(const Node& onnx_node) { const auto ng_node_factory = m_model->get_operator(onnx_node.op_type(), onnx_node.domain()); try { ov_subgraph_outputs = ng_node_factory(onnx_node); - } catch (const ::ngraph::onnx_import::error::OnnxNodeValidationFailure& e) { + } catch (const ::ov::frontend::onnx::error::OnnxNodeValidationFailure& e) { error_message = e.what(); } catch (const std::exception& exc) { error_message = error::detail::get_error_msg_prefix(onnx_node); @@ -362,11 +355,12 @@ ov::OutputVector Graph::make_ov_nodes(const Node& onnx_node) { } } if (ov_subgraph_outputs.empty()) { // translation not possible (not supported op or exception during processing) - const auto not_supported_node = std::make_shared(onnx_node.get_ng_inputs(), - onnx_node.get_outputs_size(), - onnx_node.domain(), - onnx_node.op_type(), - error_message); + const auto not_supported_node = + std::make_shared(onnx_node.get_ng_inputs(), + onnx_node.get_outputs_size(), + onnx_node.domain(), + onnx_node.op_type(), + error_message); ov_subgraph_outputs = not_supported_node->outputs(); } @@ -432,18 +426,19 @@ void Graph::set_friendly_names(const Node& onnx_node, const ov::OutputVector& ov // null node does not have tensor if (!ov::op::util::is_null(ov_subgraph_outputs[i])) { ov_subgraph_outputs[i].get_tensor().set_names({onnx_node.output(static_cast(i))}); + OPENVINO_SUPPRESS_DEPRECATED_START ov::descriptor::set_ov_tensor_legacy_name(ov_subgraph_outputs[i].get_tensor(), onnx_node.output(static_cast(i))); + OPENVINO_SUPPRESS_DEPRECATED_END } } } -OPENVINO_SUPPRESS_DEPRECATED_END const OpsetImports& Graph::get_opset_imports() const { return m_model->get_opset_imports(); } -Subgraph::Subgraph(const std::shared_ptr& model_proto, Graph* parent_graph) +Subgraph::Subgraph(const std::shared_ptr& model_proto, Graph* parent_graph) : Graph(parent_graph->model_dir(), model_proto, common::make_unique(), @@ -496,6 +491,6 @@ void Subgraph::infer_inputs_from_parent() { } } -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/graph.hpp b/src/frontends/onnx/frontend/src/core/graph.hpp index b87258d75afff0..4ee94f564c7e8d 100644 --- a/src/frontends/onnx/frontend/src/core/graph.hpp +++ b/src/frontends/onnx/frontend/src/core/graph.hpp @@ -13,18 +13,18 @@ #include "core/graph_cache.hpp" #include "core/model.hpp" #include "core/operator_set.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/frontend/extension/holder.hpp" #include "openvino/op/parameter.hpp" #include "ops_bridge.hpp" #include "utils/tensor_external_data.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { class Graph : public std::enable_shared_from_this { public: Graph(const std::string& model_dir, - const std::shared_ptr& model_proto, + const std::shared_ptr& model_proto, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions = {}); Graph() = delete; @@ -51,9 +51,9 @@ class Graph : public std::enable_shared_from_this { } virtual bool is_ov_node_in_cache(const std::string& name) const; virtual ov::Output get_ov_node_from_cache(const std::string& name); - OPENVINO_SUPPRESS_DEPRECATED_START - ov::OutputVector make_ov_nodes(const Node& onnx_node); - OPENVINO_SUPPRESS_DEPRECATED_END + + ov::OutputVector make_ov_nodes(const ov::frontend::onnx::Node& onnx_node); + const OpsetImports& get_opset_imports() const; virtual ~Graph() = default; @@ -63,19 +63,16 @@ class Graph : public std::enable_shared_from_this { protected: Graph(const std::string& model_dir, - const std::shared_ptr& model, + const std::shared_ptr& model, std::unique_ptr&& cache, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions = {}); - OPENVINO_SUPPRESS_DEPRECATED_START void set_friendly_names(const Node& onnx_node, const ov::OutputVector& ng_subgraph_outputs) const; - OPENVINO_SUPPRESS_DEPRECATED_END protected: - OPENVINO_SUPPRESS_DEPRECATED_START - ov::OutputVector make_framework_nodes(const Node& onnx_node); - OPENVINO_SUPPRESS_DEPRECATED_END + ov::OutputVector make_framework_nodes(const ov::frontend::onnx::Node& onnx_node); + void decode_to_framework_nodes(); void convert_to_ov_nodes(); void remove_dangling_parameters(); @@ -88,9 +85,8 @@ class Graph : public std::enable_shared_from_this { ov::frontend::ExtensionHolder m_extensions = {}; private: - OPENVINO_SUPPRESS_DEPRECATED_START std::vector m_nodes; - OPENVINO_SUPPRESS_DEPRECATED_END + std::string m_model_dir; detail::MappedMemoryHandles m_mmap_cache; OperatorsBridge m_ops_bridge; @@ -105,7 +101,7 @@ class Subgraph : public Graph { /// /// \param[in] model The ONNX model object. /// \param[in] parent_graph The reference to the parent graph. - Subgraph(const std::shared_ptr& model, Graph* parent_graph); + Subgraph(const std::shared_ptr& model, Graph* parent_graph); /// \brief Return nodes which are on the edge the subgraph and the parent graph. /// \return Vector of edge nodes from parent scope. @@ -137,6 +133,6 @@ inline std::ostream& operator<<(std::ostream& outs, const Graph& graph) { static const char* const ONNX_GRAPH_RT_ATTRIBUTE = "onnx_graph"; -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/graph_cache.cpp b/src/frontends/onnx/frontend/src/core/graph_cache.cpp index 8ef624c76da4fa..ec686da8ae07d5 100644 --- a/src/frontends/onnx/frontend/src/core/graph_cache.cpp +++ b/src/frontends/onnx/frontend/src/core/graph_cache.cpp @@ -6,8 +6,9 @@ #include "openvino/core/except.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { void GraphCache::emplace_node(const std::string& name, ov::Output&& node) { m_graph_cache_map[name] = std::move(node); } @@ -30,5 +31,6 @@ ov::Output GraphCache::get_node(const std::string& name) const { bool GraphCache::contains(const std::string& name) const { return (m_graph_cache_map.count(name) > 0); } -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/graph_cache.hpp b/src/frontends/onnx/frontend/src/core/graph_cache.hpp index fe021e64289dfc..c706fed7a3674a 100644 --- a/src/frontends/onnx/frontend/src/core/graph_cache.hpp +++ b/src/frontends/onnx/frontend/src/core/graph_cache.hpp @@ -10,8 +10,9 @@ #include "openvino/core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { /// \brief GraphCache stores and provides access to ONNX graph initializers. class GraphCache { public: @@ -49,5 +50,6 @@ class GraphCache { private: std::map> m_graph_cache_map; }; -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/model.cpp b/src/frontends/onnx/frontend/src/core/model.cpp index 3e59a7edaf599f..32f5d21991259e 100644 --- a/src/frontends/onnx/frontend/src/core/model.cpp +++ b/src/frontends/onnx/frontend/src/core/model.cpp @@ -10,19 +10,22 @@ #include "openvino/util/log.hpp" #include "ops_bridge.hpp" -namespace ngraph { -namespace onnx_import { -std::string get_node_domain(const ONNX_NAMESPACE::NodeProto& node_proto) { +using namespace ::ONNX_NAMESPACE; + +namespace ov { +namespace frontend { +namespace onnx { +std::string get_node_domain(const NodeProto& node_proto) { return node_proto.has_domain() ? node_proto.domain() : ""; } -std::int64_t get_opset_version(const ONNX_NAMESPACE::ModelProto& model_proto, const std::string& domain) { +std::int64_t get_opset_version(const ModelProto& model_proto, const std::string& domain) { // copy the opsets and sort them (descending order) // then return the version from the first occurrence of a given domain auto opset_imports = model_proto.opset_import(); std::sort(std::begin(opset_imports), std::end(opset_imports), - [](const ONNX_NAMESPACE::OperatorSetIdProto& lhs, const ONNX_NAMESPACE::OperatorSetIdProto& rhs) { + [](const OperatorSetIdProto& lhs, const OperatorSetIdProto& rhs) { return lhs.version() > rhs.version(); }); @@ -35,7 +38,7 @@ std::int64_t get_opset_version(const ONNX_NAMESPACE::ModelProto& model_proto, co OPENVINO_THROW("Couldn't find operator set's version for domain: ", domain, "."); } -Model::Model(std::shared_ptr model_proto, ModelOpSet&& model_opset) +Model::Model(std::shared_ptr model_proto, ModelOpSet&& model_opset) : m_model_proto{std::move(model_proto)}, m_opset{std::move(model_opset)} {} @@ -76,6 +79,6 @@ void Model::enable_opset_domain(const std::string& domain, const OperatorsBridge } } -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/model.hpp b/src/frontends/onnx/frontend/src/core/model.hpp index 6c17f17fbf4a59..189fc3fbc2b15b 100644 --- a/src/frontends/onnx/frontend/src/core/model.hpp +++ b/src/frontends/onnx/frontend/src/core/model.hpp @@ -12,14 +12,20 @@ #include "core/operator_set.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { +using ::ONNX_NAMESPACE::GraphProto; +using ::ONNX_NAMESPACE::ModelProto; +using ::ONNX_NAMESPACE::NodeProto; +using ::ONNX_NAMESPACE::OperatorSetIdProto; + /// \brief Type of container which stores opset version and domain in ONNX format -using OpsetImports = ::google::protobuf::RepeatedPtrField; +using OpsetImports = ::google::protobuf::RepeatedPtrField; -std::string get_node_domain(const ONNX_NAMESPACE::NodeProto& node_proto); +std::string get_node_domain(const NodeProto& node_proto); -std::int64_t get_opset_version(const ONNX_NAMESPACE::ModelProto& model_proto, const std::string& domain); +std::int64_t get_opset_version(const ModelProto& model_proto, const std::string& domain); class OperatorsBridge; @@ -29,7 +35,7 @@ class Model { // built based on the opset imports in the ModelProto object using ModelOpSet = std::unordered_map; - explicit Model(std::shared_ptr model_proto, ModelOpSet&& model_opset); + explicit Model(std::shared_ptr model_proto, ModelOpSet&& model_opset); Model(const Model&) = delete; Model(Model&&) = delete; @@ -40,7 +46,7 @@ class Model { const std::string& get_producer_name() const { return m_model_proto->producer_name(); } - const ONNX_NAMESPACE::GraphProto& get_graph() const { + const GraphProto& get_graph() const { return m_model_proto->graph(); } std::int64_t get_model_version() const { @@ -92,7 +98,7 @@ class Model { void enable_opset_domain(const std::string& domain, const OperatorsBridge& ops_bridge); private: - const std::shared_ptr m_model_proto; + const std::shared_ptr m_model_proto; ModelOpSet m_opset; }; @@ -100,6 +106,6 @@ inline std::ostream& operator<<(std::ostream& outs, const Model& model) { return (outs << ""); } -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/node.cpp b/src/frontends/onnx/frontend/src/core/node.cpp index b8d5a6bdfc866b..299c13eaafeec5 100644 --- a/src/frontends/onnx/frontend/src/core/node.cpp +++ b/src/frontends/onnx/frontend/src/core/node.cpp @@ -11,13 +11,14 @@ #include "core/null_node.hpp" #include "core/tensor.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { class Node::Impl { public: Impl() = delete; - Impl(const ONNX_NAMESPACE::NodeProto& node_proto, Graph* graph) + Impl(const NodeProto& node_proto, Graph* graph) : m_node_proto{&node_proto}, m_name{node_proto.has_name() ? node_proto.name() : ""}, m_domain{get_node_domain(node_proto)}, @@ -33,7 +34,7 @@ class Node::Impl { } } - Impl(const ONNX_NAMESPACE::NodeProto& node_proto, + Impl(const NodeProto& node_proto, Graph* graph, const std::unordered_map>& subgraphs) : m_node_proto{&node_proto}, @@ -87,13 +88,13 @@ class Node::Impl { T default_value, ov::element::Type type) const; - const ONNX_NAMESPACE::NodeProto& node_proto() const; + const NodeProto& node_proto() const; Graph* graph() const; private: Subgraph get_subgraph_from_attribute(const std::string& name) const; - const ONNX_NAMESPACE::NodeProto* m_node_proto; + const NodeProto* m_node_proto; std::string m_name; std::string m_domain; Graph* m_graph; @@ -104,8 +105,7 @@ class Node::Impl { std::unordered_map> m_subgraphs; }; -OPENVINO_SUPPRESS_DEPRECATED_START -const ONNX_NAMESPACE::NodeProto& Node::Impl::node_proto() const { +const NodeProto& Node::Impl::node_proto() const { return *m_node_proto; } Graph* Node::Impl::graph() const { @@ -206,9 +206,7 @@ ov::OutputVector Node::Impl::get_ng_inputs() const { if (!name.empty()) { result.push_back(m_graph->get_ov_node_from_cache(name)); } else { - OPENVINO_SUPPRESS_DEPRECATED_START result.push_back(std::make_shared()->output(0)); - OPENVINO_SUPPRESS_DEPRECATED_END } } return result; @@ -295,7 +293,7 @@ std::shared_ptr Node::Impl::get_attribute_as_constant(cons value); } -Node::Node(const ONNX_NAMESPACE::NodeProto& node_proto, Graph* graph) +Node::Node(const NodeProto& node_proto, Graph* graph) : m_pimpl{new Impl{node_proto, graph}, [](Impl* impl) { delete impl; }} {} @@ -377,7 +375,6 @@ const Attribute& Node::get_attribute(const std::string& name) const { } return *found_attr; } -OPENVINO_SUPPRESS_DEPRECATED_END template <> float Node::get_attribute_value(const std::string& name, float default_value) const { @@ -638,6 +635,6 @@ std::shared_ptr Node::get_attribute_as_constant(const std: std::move(type)); } -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/node.hpp b/src/frontends/onnx/frontend/src/core/node.hpp index 31c898b8a75b24..41ad772863b8b6 100644 --- a/src/frontends/onnx/frontend/src/core/node.hpp +++ b/src/frontends/onnx/frontend/src/core/node.hpp @@ -17,11 +17,9 @@ namespace ONNX_NAMESPACE { class NodeProto; } // namespace ONNX_NAMESPACE -namespace ngraph { -namespace element { -using ov::element::Type; -} -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace error { namespace node { struct UnknownAttribute : ov::Exception { @@ -32,7 +30,6 @@ struct UnknownAttribute : ov::Exception { }; } // namespace node - } // namespace error // forward declaration @@ -42,11 +39,13 @@ class Tensor; class SparseTensor; class Attribute; +using ::ONNX_NAMESPACE::NodeProto; + class Node { public: Node() = delete; // TODO: hide this ctor since it uses protobufs generated structures - Node(const ONNX_NAMESPACE::NodeProto& node_proto, Graph* graph); + Node(const NodeProto& node_proto, Graph* graph); Node(Node&&) noexcept; Node(const Node&); @@ -281,6 +280,6 @@ inline std::ostream& operator<<(std::ostream& outs, const Node& node) { } OPENVINO_SUPPRESS_DEPRECATED_END -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/null_node.cpp b/src/frontends/onnx/frontend/src/core/null_node.cpp index f96e78d5ab43de..e95a2255c782bf 100644 --- a/src/frontends/onnx/frontend/src/core/null_node.cpp +++ b/src/frontends/onnx/frontend/src/core/null_node.cpp @@ -6,20 +6,20 @@ #include -#include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { std::shared_ptr NullNode::clone_with_new_inputs(const ov::OutputVector& /* new_args */) const { return std::make_shared(); } -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov bool ov::op::util::is_null(const ov::Node* node) { - return dynamic_cast(node) != nullptr; + return dynamic_cast(node) != nullptr; } bool ov::op::util::is_null(const std::shared_ptr& node) { @@ -29,4 +29,3 @@ bool ov::op::util::is_null(const std::shared_ptr& node) { bool ov::op::util::is_null(const Output& output) { return is_null(output.get_node()); } -OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/onnx/frontend/src/core/null_node.hpp b/src/frontends/onnx/frontend/src/core/null_node.hpp index 484540b3d67360..c1e59b476cecba 100644 --- a/src/frontends/onnx/frontend/src/core/null_node.hpp +++ b/src/frontends/onnx/frontend/src/core/null_node.hpp @@ -4,6 +4,7 @@ #pragma once +#include "openvino/core/node.hpp" #include "openvino/op/op.hpp" namespace ov { @@ -14,9 +15,9 @@ bool is_null(const std::shared_ptr& node); bool is_null(const Output& output); } // namespace util } // namespace op -} // namespace ov -namespace ngraph { -namespace onnx_import { + +namespace frontend { +namespace onnx { /// \brief Represents a missing optional input or output of an ONNX node /// /// Some ONNX operators have inputs or outputs that are marked as optional, @@ -35,5 +36,6 @@ class NullNode : public ov::op::Op { virtual std::shared_ptr clone_with_new_inputs(const ov::OutputVector& new_args) const override; }; -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/operator_set.hpp b/src/frontends/onnx/frontend/src/core/operator_set.hpp index 2773066adbe32b..60032edd133833 100644 --- a/src/frontends/onnx/frontend/src/core/operator_set.hpp +++ b/src/frontends/onnx/frontend/src/core/operator_set.hpp @@ -10,16 +10,16 @@ #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { /// \brief Function which transforms single ONNX operator to nGraph sub-graph. -OPENVINO_SUPPRESS_DEPRECATED_START -using Operator = std::function; -OPENVINO_SUPPRESS_DEPRECATED_END + +using Operator = std::function; /// \brief Map which contains ONNX operators accessible by std::string value as a key. using OperatorSet = std::unordered_map; -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp b/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp index 4ab9d81041d36b..dc6845249a847f 100644 --- a/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp +++ b/src/frontends/onnx/frontend/src/core/sparse_tensor.hpp @@ -12,12 +12,15 @@ #include "openvino/core/type/element_type.hpp" #include "tensor.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { +using ::ONNX_NAMESPACE::SparseTensorProto; + class SparseTensor { public: SparseTensor() = delete; - SparseTensor(const ONNX_NAMESPACE::SparseTensorProto& sparse_tensor, + SparseTensor(const SparseTensorProto& sparse_tensor, const std::string& model_dir, detail::MappedMemoryHandles mmap_cache) : m_values{sparse_tensor.values(), model_dir, mmap_cache}, @@ -66,5 +69,6 @@ class SparseTensor { inline std::ostream& operator<<(std::ostream& outs, const SparseTensor& tensor) { return (outs << ""); } -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/tensor.cpp b/src/frontends/onnx/frontend/src/core/tensor.cpp index e5caa078716963..75d95f0dd56db6 100644 --- a/src/frontends/onnx/frontend/src/core/tensor.cpp +++ b/src/frontends/onnx/frontend/src/core/tensor.cpp @@ -4,8 +4,9 @@ #include "core/tensor.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { template <> std::vector Tensor::get_data() const { @@ -15,7 +16,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_DOUBLE) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_DOUBLE) { return detail::__get_data(m_tensor_proto->double_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "DOUBLE, raw data"); @@ -29,7 +30,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_FLOAT) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_FLOAT) { return detail::__get_data(m_tensor_proto->float_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "FLOAT, raw data"); @@ -43,7 +44,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_FLOAT16) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_FLOAT16) { using std::begin; using std::end; @@ -67,7 +68,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_BFLOAT16) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_BFLOAT16) { return detail::__get_data(m_tensor_proto->int32_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "INT32, raw data"); @@ -81,7 +82,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_INT8) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_INT8) { return detail::__get_data(m_tensor_proto->int32_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "INT8, raw data"); @@ -95,7 +96,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_INT16) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_INT16) { return detail::__get_data(m_tensor_proto->int32_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "INT16, raw data"); @@ -109,7 +110,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_INT32) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_INT32) { return detail::__get_data(m_tensor_proto->int32_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "INT32, raw data"); @@ -123,7 +124,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_INT64) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_INT64) { return detail::__get_data(m_tensor_proto->int64_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "INT64, raw data"); @@ -137,7 +138,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_UINT8) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_UINT8) { return detail::__get_data(m_tensor_proto->int32_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "UINT8, raw data"); @@ -151,7 +152,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_UINT16) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_UINT16) { return detail::__get_data(m_tensor_proto->int32_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "UINT16, raw data"); @@ -165,7 +166,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_UINT32) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_UINT32) { return detail::__get_data(m_tensor_proto->uint64_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "UINT32, raw data"); @@ -179,7 +180,7 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_UINT64) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_UINT64) { return detail::__get_data(m_tensor_proto->uint64_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "UINT63, raw data"); @@ -195,11 +196,12 @@ std::vector Tensor::get_data() const { if (m_tensor_proto->has_raw_data()) { return detail::__get_raw_data(m_tensor_proto->raw_data(), m_tensor_proto->data_type()); } - if (m_tensor_proto->data_type() == ONNX_NAMESPACE::TensorProto_DataType_BOOL) { + if (m_tensor_proto->data_type() == TensorProto_DataType::TensorProto_DataType_BOOL) { return detail::__get_data(m_tensor_proto->int32_data()); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "BOOL, raw data"); } -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/tensor.hpp b/src/frontends/onnx/frontend/src/core/tensor.hpp index afb34f1c18f61f..67f5fbbb1a08f0 100644 --- a/src/frontends/onnx/frontend/src/core/tensor.hpp +++ b/src/frontends/onnx/frontend/src/core/tensor.hpp @@ -21,22 +21,19 @@ using namespace ov::frontend::onnx::common; -namespace ngraph { -namespace onnx_import { -// Detecting automatically the underlying type used to store the information -// for data type of values a tensor is holding. A bug was discovered in protobuf -// which forced ONNX team to switch from `enum TensorProto_DataType` to `int32` -// in order to workaround the bug. This line allows using both versions of ONNX -// generated wrappers. -using TensorProto_DataType = decltype(ONNX_NAMESPACE::TensorProto{}.data_type()); +namespace ov { +namespace frontend { +namespace onnx { + +using ::ONNX_NAMESPACE::TensorProto; +using ::ONNX_NAMESPACE::TensorProto_DataLocation; +using ::ONNX_NAMESPACE::TensorProto_DataType; +using ::ONNX_NAMESPACE::TensorProto_DataType_Name; #define ONNX_INVALID_DATA_TYPE(data_type, expected) \ - OPENVINO_THROW("Invalid data type ", ONNX_NAMESPACE::TensorProto_DataType_Name(data_type), " expected: ", expected) -#define ONNX_UNSUPPORTED_DATA_TYPE(data_type, expected) \ - OPENVINO_THROW("Unsupported data type ", \ - ONNX_NAMESPACE::TensorProto_DataType_Name(data_type), \ - " expected: ", \ - expected) + OPENVINO_THROW("Invalid data type ", TensorProto_DataType_Name(data_type), " expected: ", expected) +#define ONNX_UNSUPPORTED_DATA_TYPE(data_type, expected) \ + OPENVINO_THROW("Unsupported data type ", TensorProto_DataType_Name(data_type), " expected: ", expected) namespace detail { namespace { @@ -65,29 +62,27 @@ inline std::vector __get_raw_data(const std::string& raw_data, int onnx_data_ class Tensor { public: enum class Type { - undefined = ONNX_NAMESPACE::TensorProto_DataType_UNDEFINED, - float32 = ONNX_NAMESPACE::TensorProto_DataType_FLOAT, - uint8 = ONNX_NAMESPACE::TensorProto_DataType_UINT8, - int8 = ONNX_NAMESPACE::TensorProto_DataType_INT8, - uint16 = ONNX_NAMESPACE::TensorProto_DataType_UINT16, - int16 = ONNX_NAMESPACE::TensorProto_DataType_INT16, - int32 = ONNX_NAMESPACE::TensorProto_DataType_INT32, - int64 = ONNX_NAMESPACE::TensorProto_DataType_INT64, - string = ONNX_NAMESPACE::TensorProto_DataType_STRING, - boolean = ONNX_NAMESPACE::TensorProto_DataType_BOOL, - float16 = ONNX_NAMESPACE::TensorProto_DataType_FLOAT16, - float64 = ONNX_NAMESPACE::TensorProto_DataType_DOUBLE, - uint32 = ONNX_NAMESPACE::TensorProto_DataType_UINT32, - uint64 = ONNX_NAMESPACE::TensorProto_DataType_UINT64, - bfloat16 = ONNX_NAMESPACE::TensorProto_DataType_BFLOAT16, - complex64 = ONNX_NAMESPACE::TensorProto_DataType_COMPLEX64, - complex128 = ONNX_NAMESPACE::TensorProto_DataType_COMPLEX128 + undefined = TensorProto_DataType::TensorProto_DataType_UNDEFINED, + float32 = TensorProto_DataType::TensorProto_DataType_FLOAT, + uint8 = TensorProto_DataType::TensorProto_DataType_UINT8, + int8 = TensorProto_DataType::TensorProto_DataType_INT8, + uint16 = TensorProto_DataType::TensorProto_DataType_UINT16, + int16 = TensorProto_DataType::TensorProto_DataType_INT16, + int32 = TensorProto_DataType::TensorProto_DataType_INT32, + int64 = TensorProto_DataType::TensorProto_DataType_INT64, + string = TensorProto_DataType::TensorProto_DataType_STRING, + boolean = TensorProto_DataType::TensorProto_DataType_BOOL, + float16 = TensorProto_DataType::TensorProto_DataType_FLOAT16, + float64 = TensorProto_DataType::TensorProto_DataType_DOUBLE, + uint32 = TensorProto_DataType::TensorProto_DataType_UINT32, + uint64 = TensorProto_DataType::TensorProto_DataType_UINT64, + bfloat16 = TensorProto_DataType::TensorProto_DataType_BFLOAT16, + complex64 = TensorProto_DataType::TensorProto_DataType_COMPLEX64, + complex128 = TensorProto_DataType::TensorProto_DataType_COMPLEX128 }; Tensor() = delete; - Tensor(const ONNX_NAMESPACE::TensorProto& tensor, - const std::string& model_dir, - detail::MappedMemoryHandles mmap_cache) + Tensor(const TensorProto& tensor, const std::string& model_dir, detail::MappedMemoryHandles mmap_cache) : m_tensor_proto{&tensor}, m_shape{std::begin(tensor.dims()), std::end(tensor.dims())}, m_model_dir{model_dir}, @@ -136,33 +131,33 @@ class Tensor { FRONT_END_THROW("Tensor has no specified data type"); } switch (m_tensor_proto->data_type()) { - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_BOOL: + case TensorProto_DataType::TensorProto_DataType_BOOL: return ov::element::boolean; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_FLOAT: + case TensorProto_DataType::TensorProto_DataType_FLOAT: return ov::element::f32; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_FLOAT16: + case TensorProto_DataType::TensorProto_DataType_FLOAT16: return ov::element::f16; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_DOUBLE: + case TensorProto_DataType::TensorProto_DataType_DOUBLE: return ov::element::f64; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT8: + case TensorProto_DataType::TensorProto_DataType_INT8: return ov::element::i8; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT16: + case TensorProto_DataType::TensorProto_DataType_INT16: return ov::element::i16; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT32: + case TensorProto_DataType::TensorProto_DataType_INT32: return ov::element::i32; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT64: + case TensorProto_DataType::TensorProto_DataType_INT64: return ov::element::i64; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT8: + case TensorProto_DataType::TensorProto_DataType_UINT8: return ov::element::u8; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT16: + case TensorProto_DataType::TensorProto_DataType_UINT16: return ov::element::u16; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT32: + case TensorProto_DataType::TensorProto_DataType_UINT32: return ov::element::u32; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT64: + case TensorProto_DataType::TensorProto_DataType_UINT64: return ov::element::u64; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_BFLOAT16: + case TensorProto_DataType::TensorProto_DataType_BFLOAT16: return ov::element::bf16; - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UNDEFINED: + case TensorProto_DataType::TensorProto_DataType_UNDEFINED: FRONT_END_THROW("Data type is Undefined"); default: ONNX_UNSUPPORTED_DATA_TYPE( @@ -172,7 +167,7 @@ class Tensor { } operator TensorProto_DataType() const { - return m_tensor_proto->data_type(); + return static_cast(m_tensor_proto->data_type()); } std::shared_ptr get_ov_constant() const { @@ -180,31 +175,31 @@ class Tensor { FRONT_END_THROW("Loading segments isn't supported"); } switch (m_tensor_proto->data_type()) { - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_BOOL: + case TensorProto_DataType::TensorProto_DataType_BOOL: return make_ov_constant(ov::element::boolean); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_FLOAT: + case TensorProto_DataType::TensorProto_DataType_FLOAT: return make_ov_constant(ov::element::f32); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_FLOAT16: + case TensorProto_DataType::TensorProto_DataType_FLOAT16: return make_ov_constant(ov::element::f16); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_DOUBLE: + case TensorProto_DataType::TensorProto_DataType_DOUBLE: return make_ov_constant(ov::element::f64); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT8: + case TensorProto_DataType::TensorProto_DataType_INT8: return make_ov_constant(ov::element::i8); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT16: + case TensorProto_DataType::TensorProto_DataType_INT16: return make_ov_constant(ov::element::i16); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT32: + case TensorProto_DataType::TensorProto_DataType_INT32: return make_ov_constant(ov::element::i32); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_INT64: + case TensorProto_DataType::TensorProto_DataType_INT64: return make_ov_constant(ov::element::i64); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT8: + case TensorProto_DataType::TensorProto_DataType_UINT8: return make_ov_constant(ov::element::u8); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT16: + case TensorProto_DataType::TensorProto_DataType_UINT16: return make_ov_constant(ov::element::u16); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT32: + case TensorProto_DataType::TensorProto_DataType_UINT32: return make_ov_constant(ov::element::u32); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UINT64: + case TensorProto_DataType::TensorProto_DataType_UINT64: return make_ov_constant(ov::element::u64); - case ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_BFLOAT16: + case TensorProto_DataType::TensorProto_DataType_BFLOAT16: return make_ov_constant(ov::element::bf16); default: ONNX_UNSUPPORTED_DATA_TYPE( @@ -276,8 +271,7 @@ class Tensor { bool has_external_data() const { return m_tensor_proto->has_data_location() && - m_tensor_proto->data_location() == - ONNX_NAMESPACE::TensorProto_DataLocation::TensorProto_DataLocation_EXTERNAL; + m_tensor_proto->data_location() == TensorProto_DataLocation::TensorProto_DataLocation_EXTERNAL; } template @@ -297,15 +291,15 @@ class Tensor { return m_tensor_proto->raw_data().data(); } switch (m_tensor_proto->data_type()) { - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT: + case TensorProto_DataType::TensorProto_DataType_FLOAT: return m_tensor_proto->float_data().data(); - case ONNX_NAMESPACE::TensorProto_DataType_INT32: + case TensorProto_DataType::TensorProto_DataType_INT32: return m_tensor_proto->int32_data().data(); - case ONNX_NAMESPACE::TensorProto_DataType_INT64: + case TensorProto_DataType::TensorProto_DataType_INT64: return m_tensor_proto->int64_data().data(); - case ONNX_NAMESPACE::TensorProto_DataType_UINT64: + case TensorProto_DataType::TensorProto_DataType_UINT64: return m_tensor_proto->uint64_data().data(); - case ONNX_NAMESPACE::TensorProto_DataType_DOUBLE: + case TensorProto_DataType::TensorProto_DataType_DOUBLE: return m_tensor_proto->double_data().data(); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "FLOAT, INT32, INT64, UINT64, DOUBLE"); @@ -316,21 +310,21 @@ class Tensor { return m_tensor_proto->raw_data().size() / get_onnx_data_size(m_tensor_proto->data_type()); } switch (m_tensor_proto->data_type()) { - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT: + case TensorProto_DataType::TensorProto_DataType_FLOAT: return m_tensor_proto->float_data_size(); - case ONNX_NAMESPACE::TensorProto_DataType_INT32: + case TensorProto_DataType::TensorProto_DataType_INT32: return m_tensor_proto->int32_data_size(); - case ONNX_NAMESPACE::TensorProto_DataType_INT64: + case TensorProto_DataType::TensorProto_DataType_INT64: return m_tensor_proto->int64_data_size(); - case ONNX_NAMESPACE::TensorProto_DataType_UINT64: + case TensorProto_DataType::TensorProto_DataType_UINT64: return m_tensor_proto->uint64_data_size(); - case ONNX_NAMESPACE::TensorProto_DataType_DOUBLE: + case TensorProto_DataType::TensorProto_DataType_DOUBLE: return m_tensor_proto->double_data_size(); } ONNX_INVALID_DATA_TYPE(m_tensor_proto->data_type(), "FLOAT, INT32, INT64, UINT64, DOUBLE"); } - const ONNX_NAMESPACE::TensorProto* m_tensor_proto; + const TensorProto* m_tensor_proto; ov::Shape m_shape; std::string m_model_dir; detail::MappedMemoryHandles m_mmap_cache; @@ -379,5 +373,6 @@ std::vector Tensor::get_data() const; template <> std::vector Tensor::get_data() const; -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/transform.cpp b/src/frontends/onnx/frontend/src/core/transform.cpp index ea98ff3356206e..39e828edeae104 100644 --- a/src/frontends/onnx/frontend/src/core/transform.cpp +++ b/src/frontends/onnx/frontend/src/core/transform.cpp @@ -20,11 +20,14 @@ #include "openvino/util/log.hpp" #include "ops_bridge.hpp" -namespace ngraph { -namespace onnx_import { +using namespace ::ONNX_NAMESPACE; + +namespace ov { +namespace frontend { +namespace onnx { namespace transform { namespace { -ONNX_NAMESPACE::TypeProto get_input_type(std::string const& name, ONNX_NAMESPACE::GraphProto& graph) { +TypeProto get_input_type(std::string const& name, GraphProto& graph) { for (const auto& input : graph.input()) { if (input.name() == name) { return input.type(); @@ -32,7 +35,7 @@ ONNX_NAMESPACE::TypeProto get_input_type(std::string const& name, ONNX_NAMESPACE } for (const auto& initializer : graph.initializer()) { if (initializer.name() == name) { - ONNX_NAMESPACE::TypeProto ret; + TypeProto ret; auto* tensor_type = ret.mutable_tensor_type(); tensor_type->set_elem_type(initializer.data_type()); @@ -51,15 +54,15 @@ ONNX_NAMESPACE::TypeProto get_input_type(std::string const& name, ONNX_NAMESPACE return value_info.type(); } } - return ONNX_NAMESPACE::TypeProto(); + return TypeProto(); } -void function_expand_and_remove_original_node(const ONNX_NAMESPACE::NodeProto& node, - const ONNX_NAMESPACE::FunctionProto& func_proto, - ONNX_NAMESPACE::GraphProto* graph, +void function_expand_and_remove_original_node(const NodeProto& node, + const FunctionProto& func_proto, + GraphProto* graph, int current_node_idx) { const auto before_expand_size = graph->node().size(); - ONNX_NAMESPACE::FunctionExpandHelper(node, func_proto, *graph); + FunctionExpandHelper(node, func_proto, *graph); const auto added_nodes = graph->node().size() - before_expand_size; // Remove the original node which contained the function @@ -73,14 +76,15 @@ void function_expand_and_remove_original_node(const ONNX_NAMESPACE::NodeProto& n } // namespace } // namespace transform -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov -void ngraph::onnx_import::transform::expand_onnx_functions(ONNX_NAMESPACE::ModelProto& model_proto) { +void ov::frontend::onnx::transform::expand_onnx_functions(ModelProto& model_proto) { auto graph_proto = model_proto.mutable_graph(); for (int i = 0; i < graph_proto->node().size(); ++i) { - ONNX_NAMESPACE::NodeProto node = graph_proto->node().Get(i); + NodeProto node = graph_proto->node().Get(i); // Check if node operation is one of the functions we want to expand if (std::find(onnx_functions_to_expand.begin(), onnx_functions_to_expand.end(), node.op_type()) == @@ -90,7 +94,7 @@ void ngraph::onnx_import::transform::expand_onnx_functions(ONNX_NAMESPACE::Model // Retrieve the operation schema from ONNX library int opset_version = static_cast(get_opset_version(model_proto, node.domain())); - const auto* schema_registry = ONNX_NAMESPACE::OpSchemaRegistry::Instance(); + const auto* schema_registry = OpSchemaRegistry::Instance(); const auto node_op_schema = schema_registry->GetSchema(node.op_type(), opset_version, node.domain()); // Check if operation schema found @@ -108,18 +112,18 @@ void ngraph::onnx_import::transform::expand_onnx_functions(ONNX_NAMESPACE::Model else if (node_op_schema->HasContextDependentFunction()) { // In order to expand a context-dependent function, we need to infer types try { - ONNX_NAMESPACE::shape_inference::InferShapes(model_proto); + shape_inference::InferShapes(model_proto); } catch (const std::exception& e) { OPENVINO_WARN << "ONNX ov::Shape inference failed: " << e.what(); } - std::vector input_types; + std::vector input_types; for (const auto& input : node.input()) { input_types.push_back(get_input_type(input, *graph_proto)); } - ONNX_NAMESPACE::FunctionBodyBuildContextImpl ctx(node, input_types); - ONNX_NAMESPACE::FunctionProto func_proto; + FunctionBodyBuildContextImpl ctx(node, input_types); + FunctionProto func_proto; node_op_schema->BuildContextDependentFunction(ctx, func_proto); // Move index to the previous position because a first node of expanded function can have also function function_expand_and_remove_original_node(node, func_proto, graph_proto, i--); @@ -127,7 +131,7 @@ void ngraph::onnx_import::transform::expand_onnx_functions(ONNX_NAMESPACE::Model } } -void ngraph::onnx_import::transform::fixup_legacy_operators(ONNX_NAMESPACE::ModelProto& model_proto) { +void ov::frontend::onnx::transform::fixup_legacy_operators(ModelProto& model_proto) { auto graph_proto = model_proto.mutable_graph(); for (auto& node : *graph_proto->mutable_node()) { auto it = std::find(legacy_ops_to_fixup.begin(), legacy_ops_to_fixup.end(), node.op_type()); diff --git a/src/frontends/onnx/frontend/src/core/transform.hpp b/src/frontends/onnx/frontend/src/core/transform.hpp index 56d751baf0fb96..fd33ac5a7bcfc0 100644 --- a/src/frontends/onnx/frontend/src/core/transform.hpp +++ b/src/frontends/onnx/frontend/src/core/transform.hpp @@ -6,10 +6,13 @@ #include -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace transform { +using ::ONNX_NAMESPACE::ModelProto; + static const std::vector onnx_functions_to_expand = {"AffineGrid", "Bernoulli", "Celu", "CenterCropPad", "NegativeLogLikelihoodLoss", "SoftmaxCrossEntropyLoss"}; @@ -21,7 +24,7 @@ static const std::vector onnx_functions_to_expand = /// with their expanded subgraphs. /// /// \param model_proto Protobuf message with ONNX model to transform. -void expand_onnx_functions(ONNX_NAMESPACE::ModelProto& model_proto); +void expand_onnx_functions(ModelProto& model_proto); static const std::vector legacy_ops_to_fixup = {"DeformableConv2D", "DetectionOutput", @@ -48,8 +51,9 @@ static const std::vector legacy_ops_to_fixup = {"DeformableConv2D", /// in the OpenVINO ONNX Frontend. /// /// \param model_proto Protobuf message with ONNX model to transform. -void fixup_legacy_operators(ONNX_NAMESPACE::ModelProto& model_proto); +void fixup_legacy_operators(ModelProto& model_proto); } // namespace transform -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/core/value_info.hpp b/src/frontends/onnx/frontend/src/core/value_info.hpp index e162cc6bab8c10..2c47b7711c6f6f 100644 --- a/src/frontends/onnx/frontend/src/core/value_info.hpp +++ b/src/frontends/onnx/frontend/src/core/value_info.hpp @@ -13,19 +13,19 @@ #include "openvino/op/parameter.hpp" #include "utils/common.hpp" -using namespace ov::frontend::onnx::common; +namespace ov { +namespace frontend { +namespace onnx { -using namespace ov::op; +using ::ONNX_NAMESPACE::ValueInfoProto; -namespace ngraph { -namespace onnx_import { class ValueInfo { public: ValueInfo(ValueInfo&&) = default; ValueInfo(const ValueInfo&) = default; ValueInfo() = delete; - explicit ValueInfo(const ONNX_NAMESPACE::ValueInfoProto& value_info_proto) : m_value_info_proto{&value_info_proto} { + explicit ValueInfo(const ValueInfoProto& value_info_proto) : m_value_info_proto{&value_info_proto} { if (value_info_proto.type().has_tensor_type()) { const auto& onnx_tensor = value_info_proto.type().tensor_type(); @@ -62,19 +62,19 @@ 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(); } private: - const ONNX_NAMESPACE::ValueInfoProto* m_value_info_proto; + const ValueInfoProto* m_value_info_proto; ov::PartialShape m_partial_shape = ov::PartialShape::dynamic(); }; @@ -82,6 +82,6 @@ inline std::ostream& operator<<(std::ostream& outs, const ValueInfo& info) { return (outs << ""); } -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/detail/subgraph_extraction.cpp b/src/frontends/onnx/frontend/src/detail/subgraph_extraction.cpp index f2341a7fccc711..2c4a1bc9c94fe3 100644 --- a/src/frontends/onnx/frontend/src/detail/subgraph_extraction.cpp +++ b/src/frontends/onnx/frontend/src/detail/subgraph_extraction.cpp @@ -15,12 +15,13 @@ #include "openvino/frontend/exception.hpp" -using namespace ov::onnx_editor; +using namespace ::ONNX_NAMESPACE; +using namespace ov::frontend::onnx; enum class PortType { InputPort, OutputPort }; namespace { -void validate_node_index(const ONNX_NAMESPACE::GraphProto& graph, const int node_idx) { +void validate_node_index(const GraphProto& graph, const int node_idx) { FRONT_END_GENERAL_CHECK(node_idx >= 0 && node_idx < graph.node_size(), "The specified node index is out of range of nodes in the original model(idx: ", std::to_string(node_idx), @@ -29,10 +30,7 @@ void validate_node_index(const ONNX_NAMESPACE::GraphProto& graph, const int node ")"); } -void validate_port_index(const ONNX_NAMESPACE::GraphProto& graph, - const int node_idx, - const int port_idx, - const PortType& port_type) { +void validate_port_index(const GraphProto& graph, const int node_idx, const int port_idx, const PortType& port_type) { const int ports_number = (port_type == PortType::InputPort) ? graph.node(node_idx).input().size() : graph.node(node_idx).output().size(); FRONT_END_GENERAL_CHECK(port_idx >= 0 && port_idx < ports_number, @@ -67,21 +65,19 @@ bool already_exists(const Container& items, const std::string& name) { } /// \brief Checks if a tensor with name "name" is produced by an input of the graph -bool is_graph_input(const ONNX_NAMESPACE::GraphProto& graph, const std::string& name) { +bool is_graph_input(const GraphProto& graph, const std::string& name) { return already_exists(graph.input(), name); } /// \brief Checks if a tensor with name "name" is produced by an initializer of the graph -bool is_graph_initializer(const ONNX_NAMESPACE::GraphProto& graph, const std::string& name) { +bool is_graph_initializer(const GraphProto& graph, const std::string& name) { return already_exists(graph.initializer(), name); } /// \brief Looks up the index of a node that produces a tensor "input_name". Used to traverse /// the graph bottom-up. Starts from a node index "current_node_idx" because it operates /// on a topologically sorted graph. -int find_source_node_idx(const ONNX_NAMESPACE::GraphProto& graph, - const int current_node_idx, - const std::string& input_name) { +int find_source_node_idx(const GraphProto& graph, const int current_node_idx, const std::string& input_name) { // Some operators (e.g. Clip) have optional inputs if (input_name.empty()) return -1; @@ -101,11 +97,10 @@ int find_source_node_idx(const ONNX_NAMESPACE::GraphProto& graph, /// \brief Looks up a descriptor for a given tensor name. This descriptor contains inferred /// shape information which is required to create new inputs and outputs in the graph. -const ONNX_NAMESPACE::ValueInfoProto find_tensor_descriptor(const ONNX_NAMESPACE::GraphProto& graph, - const std::string& tensor_name) { +const ValueInfoProto find_tensor_descriptor(const GraphProto& graph, const std::string& tensor_name) { const auto it = std::find_if(std::begin(graph.value_info()), std::end(graph.value_info()), - name_equals(tensor_name)); + name_equals(tensor_name)); if (it != std::end(graph.value_info())) { return *it; @@ -114,23 +109,23 @@ const ONNX_NAMESPACE::ValueInfoProto find_tensor_descriptor(const ONNX_NAMESPACE // as fully dynamic: // - Fully dynamic shape // - Unknown data type - auto dynamic_value_info = ONNX_NAMESPACE::ValueInfoProto(); + auto dynamic_value_info = ValueInfoProto(); dynamic_value_info.set_name(tensor_name); auto type = dynamic_value_info.mutable_type(); auto tensor_type = type->mutable_tensor_type(); - tensor_type->set_elem_type(ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_UNDEFINED); + tensor_type->set_elem_type(TensorProto_DataType::TensorProto_DataType_UNDEFINED); return dynamic_value_info; } } -std::string get_input_tensor_name(const ONNX_NAMESPACE::GraphProto& graph, const InputEdge& edge) { +std::string get_input_tensor_name(const GraphProto& graph, const InputEdge& edge) { validate_node_index(graph, edge.m_node_idx); validate_port_index(graph, edge.m_node_idx, edge.m_port_idx, PortType::InputPort); return graph.node(edge.m_node_idx).input(edge.m_port_idx); } -std::string get_output_tensor_name(const ONNX_NAMESPACE::GraphProto& graph, const OutputEdge& edge) { +std::string get_output_tensor_name(const GraphProto& graph, const OutputEdge& edge) { validate_node_index(graph, edge.m_node_idx); validate_port_index(graph, edge.m_node_idx, edge.m_port_idx, PortType::OutputPort); @@ -139,11 +134,11 @@ std::string get_output_tensor_name(const ONNX_NAMESPACE::GraphProto& graph, cons /// \brief Inserts a new input to the graph and removes an initializer that produced a tensor /// specified by an input edge passed to this function. -void replace_initializer_with_new_input(ONNX_NAMESPACE::GraphProto& graph, const InputEdge& edge) { +void replace_initializer_with_new_input(GraphProto& graph, const InputEdge& edge) { const auto tensor_name = get_input_tensor_name(graph, edge); const auto it = std::find_if(std::begin(graph.initializer()), std::end(graph.initializer()), - name_equals(tensor_name)); + name_equals(tensor_name)); FRONT_END_GENERAL_CHECK(it != std::end(graph.initializer()), "Could not find an initializer in the graph: '", @@ -173,9 +168,7 @@ void replace_initializer_with_new_input(ONNX_NAMESPACE::GraphProto& graph, const /// \note input_consumers is number of nodes which consume a new input /// \return A new input edge (along with "true") if a new input was added to the graph, /// false + the original edge otherwise. -std::pair append_new_graph_input(ONNX_NAMESPACE::GraphProto& graph, - const InputEdge& edge, - int input_consumers) { +std::pair append_new_graph_input(GraphProto& graph, const InputEdge& edge, int input_consumers) { const auto tensor_name = get_input_tensor_name(graph, edge); if (already_exists(graph.input(), tensor_name) && !is_graph_initializer(graph, tensor_name)) { // no need to append a new input if an edge points to an existing one in the model @@ -222,7 +215,7 @@ std::pair append_new_graph_input(ONNX_NAMESPACE::GraphProto& /// \brief Adds new outputs to the ONNX graph for an edge specified by a user /// The shape for this output is taken from a previously executed shape inference of the /// original model. -void append_new_graph_output(ONNX_NAMESPACE::GraphProto& graph, const OutputEdge& edge) { +void append_new_graph_output(GraphProto& graph, const OutputEdge& edge) { const auto tensor_name = get_output_tensor_name(graph, edge); auto& new_output = *(graph.add_output()); // copy the intermediate tensor's properties to the newly created @@ -234,8 +227,8 @@ void append_new_graph_output(ONNX_NAMESPACE::GraphProto& graph, const OutputEdge /// It's intended to work with ONNX graph inputs, outputs and initializers only. template void discard_by_name(Container& all_items, const std::set& items_to_keep) { - static_assert(std::is_same::value || - std::is_same::value, + static_assert(std::is_same::value || + std::is_same::value, "Unsupported value type of the container"); // The tested item can be discarded if its name is not found in the items_to_keep set @@ -255,7 +248,7 @@ void discard_by_name(Container& all_items, const std::set& items_to /// \brief Removes all nodes from a container keeping the ones whose index is in nodes_to_keep template void discard_nodes(Container& all_nodes, const std::set& nodes_to_keep) { - static_assert(std::is_same::value, + static_assert(std::is_same::value, "Unsupported value type of the container"); int idx = 0; @@ -274,9 +267,7 @@ void discard_nodes(Container& all_nodes, const std::set& nodes_to_keep) { /* -----------------------------------------------------------------------------------------------*/ -SubgraphExtractor::SubgraphExtractor(ONNX_NAMESPACE::GraphProto& graph) - : m_onnx_graph(graph), - m_node_inputs(graph.node_size()) { +SubgraphExtractor::SubgraphExtractor(GraphProto& graph) : m_onnx_graph(graph), m_node_inputs(graph.node_size()) { // gathers information about the graph - input edges of every node and number of "consumers" // of all tensors in the graph for (int i = 0; i < graph.node_size(); ++i) { diff --git a/src/frontends/onnx/frontend/src/detail/subgraph_extraction.hpp b/src/frontends/onnx/frontend/src/detail/subgraph_extraction.hpp index d16db361b95333..b520ac80b80b63 100644 --- a/src/frontends/onnx/frontend/src/detail/subgraph_extraction.hpp +++ b/src/frontends/onnx/frontend/src/detail/subgraph_extraction.hpp @@ -19,10 +19,14 @@ class ValueInfoProto; } // namespace ONNX_NAMESPACE namespace ov { -namespace onnx_editor { +namespace frontend { +namespace onnx { + +using ::ONNX_NAMESPACE::GraphProto; + /// \brief Subgraph extraction helper structure struct SubgraphExtractor { - SubgraphExtractor(ONNX_NAMESPACE::GraphProto& graph); + SubgraphExtractor(GraphProto& graph); /// \brief Adds new inputs to the graph and connects them to the nodes indicated by /// the provided input edges. @@ -70,7 +74,7 @@ struct SubgraphExtractor { }; private: - ONNX_NAMESPACE::GraphProto& m_onnx_graph; + GraphProto& m_onnx_graph; // Graph traversal helper: the input names of each node std::vector> m_node_inputs; @@ -96,5 +100,6 @@ struct SubgraphExtractor { /// \param subgraph An object describing the subgraph to be extracted (elems to be kept) void extract_subgraph_from_onnx_model(const SubgraphComponents& subgraph); }; -} // namespace onnx_editor +} // namespace onnx +} // namespace frontend } // namespace ov diff --git a/src/frontends/onnx/frontend/src/edge_mapper.cpp b/src/frontends/onnx/frontend/src/edge_mapper.cpp index 22e1fb4b8bc009..aad4b09e32bf89 100644 --- a/src/frontends/onnx/frontend/src/edge_mapper.cpp +++ b/src/frontends/onnx/frontend/src/edge_mapper.cpp @@ -12,9 +12,9 @@ #include "openvino/frontend/exception.hpp" using namespace ov; -using namespace ov::onnx_editor; +using namespace ov::frontend::onnx; -onnx_editor::EdgeMapper::EdgeMapper(const ONNX_NAMESPACE::GraphProto& graph_proto) +EdgeMapper::EdgeMapper(const GraphProto& graph_proto) : m_node_inputs(graph_proto.node().size()), m_node_outputs(graph_proto.node().size()) { int topological_index = 0; @@ -36,8 +36,7 @@ onnx_editor::EdgeMapper::EdgeMapper(const ONNX_NAMESPACE::GraphProto& graph_prot } } -std::vector onnx_editor::EdgeMapper::find_node_indexes(const std::string& node_name, - const std::string& output_name) const { +std::vector EdgeMapper::find_node_indexes(const std::string& node_name, const std::string& output_name) const { if (!output_name.empty()) { const auto& index_iter = m_node_output_name_to_index.find(output_name); if (index_iter != std::end(m_node_output_name_to_index)) { @@ -57,7 +56,7 @@ std::vector onnx_editor::EdgeMapper::find_node_indexes(const std::string& n return result; }; -int onnx_editor::EdgeMapper::get_node_output_idx(int node_index, const std::string& output_name) const { +int EdgeMapper::get_node_output_idx(int node_index, const std::string& output_name) const { FRONT_END_GENERAL_CHECK(node_index >= 0 && node_index < static_cast(m_node_outputs.size()), "Node with index: ", std::to_string(node_index), @@ -73,7 +72,7 @@ int onnx_editor::EdgeMapper::get_node_output_idx(int node_index, const std::stri return static_cast(out_port_idx - std::begin(node_outputs)); } -std::vector onnx_editor::EdgeMapper::get_node_input_indexes(int node_index, const std::string& input_name) const { +std::vector EdgeMapper::get_node_input_indexes(int node_index, const std::string& input_name) const { FRONT_END_GENERAL_CHECK(node_index >= 0 && node_index < static_cast(m_node_inputs.size()), "Node with index: ", std::to_string(node_index), @@ -96,7 +95,7 @@ std::vector onnx_editor::EdgeMapper::get_node_input_indexes(int node_index, return node_inputs_indexes; } -InputEdge onnx_editor::EdgeMapper::find_input_edge(const EditorNode& node, const EditorInput& in) const { +InputEdge EdgeMapper::find_input_edge(const EditorNode& node, const EditorInput& in) const { int node_index = node.m_node_index; if (node_index == -1) { // the node index is not provided // identification can be both based on node name and output name (if the node index is not provided) @@ -160,7 +159,7 @@ InputEdge onnx_editor::EdgeMapper::find_input_edge(const EditorNode& node, const } } -OutputEdge onnx_editor::EdgeMapper::find_output_edge(const EditorNode& node, const EditorOutput& out) const { +OutputEdge EdgeMapper::find_output_edge(const EditorNode& node, const EditorOutput& out) const { int node_index = node.m_node_index; if (node_index == -1) { // the node index is not provided // identification can be both based on node name and output name (if the node index is not provided) @@ -210,11 +209,11 @@ OutputEdge onnx_editor::EdgeMapper::find_output_edge(const EditorNode& node, con return OutputEdge{node_index, output_idx}; } -OutputEdge onnx_editor::EdgeMapper::find_output_edge(const std::string& output_name) const { +OutputEdge EdgeMapper::find_output_edge(const std::string& output_name) const { return find_output_edge(EditorNode{EditorOutput{output_name}}, EditorOutput{output_name}); } -std::vector onnx_editor::EdgeMapper::find_output_consumers(const std::string& output_name) const { +std::vector EdgeMapper::find_output_consumers(const std::string& output_name) const { const auto matched_nodes_range = m_output_consumers_index.equal_range(output_name); std::vector input_edges; for (auto it = matched_nodes_range.first; it != matched_nodes_range.second; ++it) { @@ -233,7 +232,7 @@ std::vector onnx_editor::EdgeMapper::find_output_consumers(const std: return input_edges; } -bool onnx_editor::EdgeMapper::is_correct_and_unambiguous_node(const EditorNode& node) const { +bool EdgeMapper::is_correct_and_unambiguous_node(const EditorNode& node) const { if (node.m_node_index >= 0 && node.m_node_index < static_cast(m_node_inputs.size())) { return true; } @@ -250,7 +249,7 @@ void check_node(bool condition, const EditorNode& node) { } } // namespace -int onnx_editor::EdgeMapper::get_node_index(const EditorNode& node) const { +int EdgeMapper::get_node_index(const EditorNode& node) const { if (node.m_node_index != -1) { // the node index provided check_node_index(node.m_node_index); return node.m_node_index; @@ -260,7 +259,7 @@ int onnx_editor::EdgeMapper::get_node_index(const EditorNode& node) const { return indexes[0]; } -bool onnx_editor::EdgeMapper::is_correct_tensor_name(const std::string& name) const { +bool EdgeMapper::is_correct_tensor_name(const std::string& name) const { if (m_node_output_name_to_index.find(name) != std::end(m_node_output_name_to_index)) { return true; } @@ -270,7 +269,7 @@ bool onnx_editor::EdgeMapper::is_correct_tensor_name(const std::string& name) co return false; } -std::vector onnx_editor::EdgeMapper::get_input_ports(const EditorNode& node) const { +std::vector EdgeMapper::get_input_ports(const EditorNode& node) const { check_node(is_correct_and_unambiguous_node(node), node); auto node_index = node.m_node_index; if (node_index == -1) { // the node index is provided @@ -281,7 +280,7 @@ std::vector onnx_editor::EdgeMapper::get_input_ports(const EditorNo return m_node_inputs[node_index]; } -std::vector onnx_editor::EdgeMapper::get_output_ports(const EditorNode& node) const { +std::vector EdgeMapper::get_output_ports(const EditorNode& node) const { check_node(is_correct_and_unambiguous_node(node), node); auto node_index = node.m_node_index; if (node_index == -1) // the node index is provided @@ -293,7 +292,7 @@ std::vector onnx_editor::EdgeMapper::get_output_ports(const EditorN return m_node_outputs[node_index]; } -std::string onnx_editor::EdgeMapper::get_source_tensor_name(const InputEdge& edge) const { +std::string EdgeMapper::get_source_tensor_name(const InputEdge& edge) const { if (edge.m_node_idx >= 0 && edge.m_node_idx < static_cast(m_node_inputs.size()) && edge.m_port_idx >= 0 && edge.m_port_idx < static_cast(m_node_inputs[edge.m_node_idx].size())) { return m_node_inputs[edge.m_node_idx][edge.m_port_idx]; @@ -301,7 +300,7 @@ std::string onnx_editor::EdgeMapper::get_source_tensor_name(const InputEdge& edg return ""; } -std::string onnx_editor::EdgeMapper::get_target_tensor_name(const OutputEdge& edge) const { +std::string EdgeMapper::get_target_tensor_name(const OutputEdge& edge) const { if (edge.m_node_idx >= 0 && edge.m_node_idx < static_cast(m_node_outputs.size()) && edge.m_port_idx >= 0 && edge.m_port_idx < static_cast(m_node_outputs[edge.m_node_idx].size())) { return m_node_outputs[edge.m_node_idx][edge.m_port_idx]; @@ -309,7 +308,7 @@ std::string onnx_editor::EdgeMapper::get_target_tensor_name(const OutputEdge& ed return ""; } -void onnx_editor::EdgeMapper::check_node_index(int node_index) const { +void EdgeMapper::check_node_index(int node_index) const { FRONT_END_GENERAL_CHECK(node_index >= 0 && node_index < static_cast(m_node_inputs.size()), "Provided node index: " + std::to_string(node_index) + " is out of scope"); } diff --git a/src/frontends/onnx/frontend/src/edge_mapper.hpp b/src/frontends/onnx/frontend/src/edge_mapper.hpp index b4b4d846337bbb..2c4ae25259efb5 100644 --- a/src/frontends/onnx/frontend/src/edge_mapper.hpp +++ b/src/frontends/onnx/frontend/src/edge_mapper.hpp @@ -17,7 +17,10 @@ class GraphProto; } // namespace ONNX_NAMESPACE namespace ov { -namespace onnx_editor { +namespace frontend { +namespace onnx { +using ::ONNX_NAMESPACE::GraphProto; + /// \brief A class which allows specifying InputEdge and OutputEdge by user-friendly ONNX /// names. class EdgeMapper { @@ -30,7 +33,7 @@ class EdgeMapper { /// is outdated. In such a case the update method should be called. /// /// \param graph_proto Reference to a GraphProto object. - EdgeMapper(const ONNX_NAMESPACE::GraphProto& graph_proto); + EdgeMapper(const GraphProto& graph_proto); /// \brief Returns the InputEdge based on a node (node name or output name) /// and an input (input name or input index). @@ -148,5 +151,6 @@ class EdgeMapper { std::map m_node_output_name_to_index; std::multimap m_output_consumers_index; }; -} // namespace onnx_editor +} // namespace onnx +} // namespace frontend } // namespace ov diff --git a/src/frontends/onnx/frontend/src/editor.cpp b/src/frontends/onnx/frontend/src/editor.cpp index b3b0d28f99c24d..b141ef9bffc91b 100644 --- a/src/frontends/onnx/frontend/src/editor.cpp +++ b/src/frontends/onnx/frontend/src/editor.cpp @@ -19,14 +19,11 @@ #include "utils/onnx_internal.hpp" using namespace ov; -using namespace ov::onnx_editor; +using namespace ov::frontend::onnx; using namespace ov::frontend::onnx::common; - -OPENVINO_SUPPRESS_DEPRECATED_START +using namespace ::ONNX_NAMESPACE; namespace { -using namespace ONNX_NAMESPACE; - ValueInfoProto* find_graph_input(GraphProto& graph, const std::string& name) { for (int i = 0; i < graph.input_size(); ++i) { auto* input_desc = graph.mutable_input(i); @@ -92,7 +89,7 @@ void modify_input_type(ValueInfoProto& onnx_input, const ov::element::Type_t ele tensor_type->set_elem_type(ov_to_onnx_data_type(elem_type)); } -void add_dim_to_onnx_shape(const Dimension& dim, ONNX_NAMESPACE::TensorShapeProto& onnx_shape) { +void add_dim_to_onnx_shape(const Dimension& dim, TensorShapeProto& onnx_shape) { auto* new_dim = onnx_shape.add_dim(); if (dim.is_static()) { new_dim->set_dim_value(dim.get_length()); @@ -179,15 +176,15 @@ bool is_topologically_sorted(const GraphProto& graph) { std::transform(std::begin(graph.input()), std::end(graph.input()), std::inserter(known_tensors, std::end(known_tensors)), - extract_name); + extract_name); std::transform(std::begin(graph.output()), std::end(graph.output()), std::inserter(known_tensors, std::end(known_tensors)), - extract_name); + extract_name); std::transform(std::begin(graph.initializer()), std::end(graph.initializer()), std::inserter(known_tensors, std::end(known_tensors)), - extract_name); + extract_name); for (const auto& node : graph.node()) { for (const auto& input : node.input()) { @@ -256,13 +253,13 @@ void graph_topological_sort(GraphProto* graph) { class InferShapesAutoRelease { public: - InferShapesAutoRelease(std::shared_ptr model_proto) + InferShapesAutoRelease(std::shared_ptr model_proto) : m_model_proto{model_proto}, m_infer_shapes_was_run{false} {} bool infer_shapes() { try { // unexpected exceptions of external onnx lib - ONNX_NAMESPACE::shape_inference::InferShapes(*m_model_proto); + shape_inference::InferShapes(*m_model_proto); m_infer_shapes_was_run = true; } catch (...) { release(); @@ -284,38 +281,35 @@ class InferShapesAutoRelease { } private: - std::shared_ptr m_model_proto; + std::shared_ptr m_model_proto; bool m_infer_shapes_was_run; }; } // namespace /// \brief A helper class used to hold the ModelProto object as its field -struct onnx_editor::ONNXModelEditor::Impl { - std::shared_ptr m_model_proto; +struct ONNXModelEditor::Impl { + std::shared_ptr m_model_proto; EdgeMapper m_edge_mapper; bool m_is_mapper_updated = false; Impl() = delete; - Impl(const std::shared_ptr& model_proto) : m_model_proto{model_proto} { + Impl(const std::shared_ptr& model_proto) : m_model_proto{model_proto} { graph_topological_sort(m_model_proto->mutable_graph()); } - Impl(const std::string& model_path) - : Impl(std::make_shared(parse_from_file(model_path))) {} + Impl(const std::string& model_path) : Impl(std::make_shared(parse_from_file(model_path))) {} - Impl(std::istream& model_stream) - : Impl(std::make_shared(parse_from_istream(model_stream))) {} + Impl(std::istream& model_stream) : Impl(std::make_shared(parse_from_istream(model_stream))) {} #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) - Impl(const std::wstring& model_path) - : Impl(std::make_shared(parse_from_file(model_path))) {} + Impl(const std::wstring& model_path) : Impl(std::make_shared(parse_from_file(model_path))) {} #endif }; -onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::string& model_path, - const bool enable_mmap, - frontend::ExtensionHolder extensions) +ONNXModelEditor::ONNXModelEditor(const std::string& model_path, + const bool enable_mmap, + frontend::ExtensionHolder extensions) : m_model_path{model_path}, m_mmap_cache{enable_mmap ? std::make_shared>>() : nullptr}, @@ -325,9 +319,9 @@ onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::string& model_path, }} {} #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) -onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::wstring& model_path, - const bool enable_mmap, - frontend::ExtensionHolder extensions) +ONNXModelEditor::ONNXModelEditor(const std::wstring& model_path, + const bool enable_mmap, + frontend::ExtensionHolder extensions) : m_extensions{std::move(extensions)}, m_model_path{ov::util::wstring_to_string(model_path)}, m_mmap_cache{enable_mmap ? std::make_shared>>() @@ -337,10 +331,10 @@ onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::wstring& model_path, }} {} #endif -onnx_editor::ONNXModelEditor::ONNXModelEditor(std::istream& model_stream, - const std::string& model_path, - const bool enable_mmap, - frontend::ExtensionHolder extensions) +ONNXModelEditor::ONNXModelEditor(std::istream& model_stream, + const std::string& model_path, + const bool enable_mmap, + frontend::ExtensionHolder extensions) : m_model_path{model_path}, m_mmap_cache{enable_mmap ? std::make_shared>>() : nullptr}, @@ -349,11 +343,11 @@ onnx_editor::ONNXModelEditor::ONNXModelEditor(std::istream& model_stream, delete impl; }} {} -const std::string& onnx_editor::ONNXModelEditor::model_path() const { +const std::string& ONNXModelEditor::model_path() const { return m_model_path; } -void onnx_editor::ONNXModelEditor::serialize(const std::string& out_file_path) const { +void ONNXModelEditor::serialize(const std::string& out_file_path) const { std::ofstream out_file{out_file_path, std::ios::out | std::ios::binary}; OPENVINO_ASSERT(out_file.is_open(), "Could not open the file: ", out_file_path); @@ -364,7 +358,7 @@ void onnx_editor::ONNXModelEditor::serialize(const std::string& out_file_path) c out_file.close(); } -void onnx_editor::ONNXModelEditor::set_input_types(const std::map& input_types) { +void ONNXModelEditor::set_input_types(const std::map& input_types) { auto* onnx_graph = m_pimpl->m_model_proto->mutable_graph(); for (const auto& input_desc : input_types) { @@ -377,7 +371,7 @@ void onnx_editor::ONNXModelEditor::set_input_types(const std::mapm_model_proto->mutable_graph(); auto* onnx_input = find_graph_input(*onnx_graph, tensor_name); @@ -389,10 +383,10 @@ ov::element::Type_t onnx_editor::ONNXModelEditor::get_input_type(const std::stri onnx_input->name()); auto& tensor_type = type_proto.tensor_type(); auto type = tensor_type.elem_type(); - return ngraph::onnx_import::common::get_ov_element_type(type); + return ov::frontend::onnx::common::get_ov_element_type(type); } -void onnx_editor::ONNXModelEditor::set_input_shapes(const std::map& input_shapes) { +void 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) { @@ -405,7 +399,7 @@ void onnx_editor::ONNXModelEditor::set_input_shapes(const std::mapm_model_proto->mutable_graph(); @@ -447,9 +441,9 @@ PartialShape onnx_editor::ONNXModelEditor::get_tensor_shape(const std::string& t } } -void onnx_editor::ONNXModelEditor::extract_subgraph(const std::vector& inputs, - const std::vector& outputs, - const bool merge_inputs) { +void ONNXModelEditor::extract_subgraph(const std::vector& inputs, + const std::vector& outputs, + const bool merge_inputs) { if (inputs.empty() && outputs.empty()) { return; } @@ -469,7 +463,7 @@ void onnx_editor::ONNXModelEditor::extract_subgraph(const std::vector m_pimpl->m_is_mapper_updated = false; } -std::vector onnx_editor::ONNXModelEditor::model_inputs() const { +std::vector ONNXModelEditor::model_inputs() const { const auto& graph = m_pimpl->m_model_proto->graph(); std::vector inputs; for (const auto& in : graph.input()) { @@ -483,7 +477,7 @@ std::vector onnx_editor::ONNXModelEditor::model_inputs() const { return inputs; } -std::vector onnx_editor::ONNXModelEditor::model_outputs() const { +std::vector ONNXModelEditor::model_outputs() const { const auto& graph = m_pimpl->m_model_proto->graph(); std::vector outputs; outputs.reserve(graph.output_size()); @@ -491,17 +485,17 @@ std::vector onnx_editor::ONNXModelEditor::model_outputs() const { std::transform(graph.output().begin(), graph.output().end(), std::back_inserter(outputs), - extract_name); + extract_name); return outputs; } -std::string onnx_editor::ONNXModelEditor::get_source_tensor_name(const InputEdge& edge) const { +std::string ONNXModelEditor::get_source_tensor_name(const InputEdge& edge) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.get_source_tensor_name(edge); } -bool onnx_editor::ONNXModelEditor::is_input(const InputEdge& edge) const { +bool ONNXModelEditor::is_input(const InputEdge& edge) const { const auto& tensor_name = get_source_tensor_name(edge); if (tensor_name.empty()) { return false; @@ -511,12 +505,12 @@ bool onnx_editor::ONNXModelEditor::is_input(const InputEdge& edge) const { } } -std::string onnx_editor::ONNXModelEditor::get_target_tensor_name(const OutputEdge& edge) const { +std::string ONNXModelEditor::get_target_tensor_name(const OutputEdge& edge) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.get_target_tensor_name(edge); } -bool onnx_editor::ONNXModelEditor::is_output(const OutputEdge& edge) const { +bool ONNXModelEditor::is_output(const OutputEdge& edge) const { const auto& tensor_name = get_target_tensor_name(edge); if (tensor_name.empty()) { return false; @@ -526,20 +520,18 @@ bool onnx_editor::ONNXModelEditor::is_output(const OutputEdge& edge) const { } } -std::string onnx_editor::ONNXModelEditor::model_string() const { +std::string ONNXModelEditor::model_string() const { return m_pimpl->m_model_proto->SerializeAsString(); } -std::shared_ptr onnx_editor::ONNXModelEditor::get_function() const { - OPENVINO_SUPPRESS_DEPRECATED_START - return ngraph::onnx_import::detail::import_onnx_model(m_pimpl->m_model_proto, - m_model_path, - m_mmap_cache, - m_extensions); - OPENVINO_SUPPRESS_DEPRECATED_END +std::shared_ptr ONNXModelEditor::get_function() const { + return ov::frontend::onnx::detail::import_onnx_model(m_pimpl->m_model_proto, + m_model_path, + m_mmap_cache, + m_extensions); } -void onnx_editor::ONNXModelEditor::set_input_values( +void ONNXModelEditor::set_input_values( const std::map>& input_values) { auto onnx_graph = m_pimpl->m_model_proto->mutable_graph(); @@ -563,7 +555,7 @@ void onnx_editor::ONNXModelEditor::set_input_values( } } -void onnx_editor::ONNXModelEditor::set_tensor_name(const std::string& current_name, const std::string& new_name) { +void ONNXModelEditor::set_tensor_name(const std::string& current_name, const std::string& new_name) { OPENVINO_ASSERT(!new_name.empty(), "New name must not be empty."); const auto graph = m_pimpl->m_model_proto->mutable_graph(); @@ -606,7 +598,7 @@ void onnx_editor::ONNXModelEditor::set_tensor_name(const std::string& current_na } } -void onnx_editor::ONNXModelEditor::set_node_name(const EditorNode& node, const std::string& new_name) { +void ONNXModelEditor::set_node_name(const EditorNode& node, const std::string& new_name) { const auto node_idx = m_pimpl->m_edge_mapper.get_node_index(node); const auto graph = m_pimpl->m_model_proto->mutable_graph(); @@ -615,7 +607,7 @@ void onnx_editor::ONNXModelEditor::set_node_name(const EditorNode& node, const s *graph->mutable_node(node_idx)->mutable_name() = new_name; } -std::string onnx_editor::ONNXModelEditor::get_node_name(const EditorNode& node) const { +std::string ONNXModelEditor::get_node_name(const EditorNode& node) const { if (node.m_node_index >= 0) { if (node.m_node_index >= m_pimpl->m_model_proto->graph().node().size()) { return ""; @@ -627,7 +619,7 @@ std::string onnx_editor::ONNXModelEditor::get_node_name(const EditorNode& node) } } -void onnx_editor::ONNXModelEditor::clear_nodes_name(const std::string& name) { +void ONNXModelEditor::clear_nodes_name(const std::string& name) { const auto graph = m_pimpl->m_model_proto->mutable_graph(); m_pimpl->m_is_mapper_updated = false; @@ -639,9 +631,9 @@ void onnx_editor::ONNXModelEditor::clear_nodes_name(const std::string& name) { } } -void onnx_editor::ONNXModelEditor::set_name_for_dimension(const std::string& node_name, - size_t shape_dim_index, - const std::string& dim_name) { +void ONNXModelEditor::set_name_for_dimension(const std::string& node_name, + size_t shape_dim_index, + const std::string& dim_name) { OPENVINO_ASSERT(!dim_name.empty(), "Dimension name must not be empty."); const auto graph = m_pimpl->m_model_proto->mutable_graph(); @@ -674,68 +666,68 @@ void onnx_editor::ONNXModelEditor::set_name_for_dimension(const std::string& nod set_dim_param(value_info); } -void onnx_editor::ONNXModelEditor::update_mapper_if_needed() const { +void ONNXModelEditor::update_mapper_if_needed() const { if (!m_pimpl->m_is_mapper_updated) { m_pimpl->m_edge_mapper = EdgeMapper(m_pimpl->m_model_proto->graph()); } m_pimpl->m_is_mapper_updated = true; } -InputEdge onnx_editor::ONNXModelEditor::find_input_edge(const EditorNode& node, const EditorInput& input) const { +InputEdge ONNXModelEditor::find_input_edge(const EditorNode& node, const EditorInput& input) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.find_input_edge(node, input); } -OutputEdge onnx_editor::ONNXModelEditor::find_output_edge(const EditorNode& node, const EditorOutput& input) const { +OutputEdge ONNXModelEditor::find_output_edge(const EditorNode& node, const EditorOutput& input) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.find_output_edge(node, input); } -OutputEdge onnx_editor::ONNXModelEditor::find_output_edge(const std::string& output_name) const { +OutputEdge ONNXModelEditor::find_output_edge(const std::string& output_name) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.find_output_edge(output_name); } -std::vector onnx_editor::ONNXModelEditor::find_output_consumers(const std::string& output_name) const { +std::vector ONNXModelEditor::find_output_consumers(const std::string& output_name) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.find_output_consumers(output_name); } -bool onnx_editor::ONNXModelEditor::is_correct_and_unambiguous_node(const EditorNode& node) const { +bool ONNXModelEditor::is_correct_and_unambiguous_node(const EditorNode& node) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.is_correct_and_unambiguous_node(node); } -int onnx_editor::ONNXModelEditor::get_node_index(const EditorNode& node) const { +int ONNXModelEditor::get_node_index(const EditorNode& node) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.get_node_index(node); } -bool onnx_editor::ONNXModelEditor::is_correct_tensor_name(const std::string& name) const { +bool ONNXModelEditor::is_correct_tensor_name(const std::string& name) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.is_correct_tensor_name(name); } -std::vector onnx_editor::ONNXModelEditor::get_input_ports(const EditorNode& node) const { +std::vector ONNXModelEditor::get_input_ports(const EditorNode& node) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.get_input_ports(node); } -std::vector onnx_editor::ONNXModelEditor::get_output_ports(const EditorNode& node) const { +std::vector ONNXModelEditor::get_output_ports(const EditorNode& node) const { update_mapper_if_needed(); return m_pimpl->m_edge_mapper.get_output_ports(node); } -std::shared_ptr onnx_editor::ONNXModelEditor::decode() { - return ngraph::onnx_import::detail::decode_to_framework_nodes(m_pimpl->m_model_proto, - m_model_path, - m_mmap_cache, - m_extensions); +std::shared_ptr ONNXModelEditor::decode() { + return ov::frontend::onnx::detail::decode_to_framework_nodes(m_pimpl->m_model_proto, + m_model_path, + m_mmap_cache, + m_extensions); } -void onnx_editor::ONNXModelEditor::add_output(const OutputEdge& output_edge) const { +void ONNXModelEditor::add_output(const OutputEdge& output_edge) const { auto onnx_graph = m_pimpl->m_model_proto->mutable_graph(); - std::vector onnx_output; + std::vector onnx_output; onnx_output.push_back(output_edge); SubgraphExtractor editor{*onnx_graph}; editor.add_new_outputs(onnx_output); diff --git a/src/frontends/onnx/frontend/src/editor.hpp b/src/frontends/onnx/frontend/src/editor.hpp index b66d2e6cd757fc..ee5a159d8a4cb3 100644 --- a/src/frontends/onnx/frontend/src/editor.hpp +++ b/src/frontends/onnx/frontend/src/editor.hpp @@ -9,7 +9,6 @@ #include #include "editor_types.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/model.hpp" #include "openvino/frontend/extension/holder.hpp" #include "openvino/frontend/extension/progress_reporter.hpp" @@ -18,7 +17,8 @@ #include "utils/tensor_external_data.hpp" namespace ov { -namespace onnx_editor { +namespace frontend { +namespace onnx { /// \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 @@ -305,11 +305,12 @@ class ONNXModelEditor final { void update_mapper_if_needed() const; const std::string m_model_path; - ngraph::onnx_import::detail::MappedMemoryHandles m_mmap_cache; + ov::frontend::onnx::detail::MappedMemoryHandles m_mmap_cache; frontend::ExtensionHolder m_extensions; struct Impl; std::unique_ptr m_pimpl; }; -} // namespace onnx_editor +} // namespace onnx +} // namespace frontend } // namespace ov diff --git a/src/frontends/onnx/frontend/src/editor_types.hpp b/src/frontends/onnx/frontend/src/editor_types.hpp index 56b341e2c903ec..75d8659c263340 100644 --- a/src/frontends/onnx/frontend/src/editor_types.hpp +++ b/src/frontends/onnx/frontend/src/editor_types.hpp @@ -22,7 +22,8 @@ struct Edge { const int m_port_idx; const std::string m_new_input_name; }; -namespace onnx_editor { +namespace frontend { +namespace onnx { /// \brief Defines an edge connected to an input of any node in the graph. /// It consists of a node index in the processed ONNX model and the port index. /// The node index should point to a node in the topological sort of the underlying @@ -123,5 +124,6 @@ struct EditorNode { std::string m_output_name = ""; int m_node_index = -1; }; -} // namespace onnx_editor +} // namespace onnx +} // namespace frontend } // namespace ov diff --git a/src/frontends/onnx/frontend/src/exceptions.cpp b/src/frontends/onnx/frontend/src/exceptions.cpp index 95cc74d5009d16..ffbf966b2130c9 100644 --- a/src/frontends/onnx/frontend/src/exceptions.cpp +++ b/src/frontends/onnx/frontend/src/exceptions.cpp @@ -6,15 +6,11 @@ #include -#include "openvino/core/deprecated.hpp" - -OPENVINO_SUPPRESS_DEPRECATED_START - namespace ov { namespace frontend { namespace onnx_error { namespace detail { -std::string get_error_msg_prefix(const ngraph::onnx_import::Node& node) { +std::string get_error_msg_prefix(const ov::frontend::onnx::Node& node) { std::stringstream ss; ss << "While validating ONNX node '" << node << "'"; return ss.str(); @@ -24,7 +20,7 @@ std::string get_error_msg_prefix(const ngraph::onnx_import::Node& node) { void OnnxNodeValidationFailure::create(const char* file, int line, const char* check_string, - const ngraph::onnx_import::Node& node, + const ov::frontend::onnx::Node& node, const std::string& explanation) { throw OnnxNodeValidationFailure( make_what(file, line, check_string, detail::get_error_msg_prefix(node), explanation)); @@ -32,5 +28,3 @@ void OnnxNodeValidationFailure::create(const char* file, } // namespace onnx_error } // namespace frontend } // namespace ov - -OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/onnx/frontend/src/exceptions.hpp b/src/frontends/onnx/frontend/src/exceptions.hpp index 37938f7b0e8598..388c9a4241f55e 100644 --- a/src/frontends/onnx/frontend/src/exceptions.hpp +++ b/src/frontends/onnx/frontend/src/exceptions.hpp @@ -17,7 +17,7 @@ namespace onnx_error { namespace detail { OPENVINO_SUPPRESS_DEPRECATED_START -std::string get_error_msg_prefix(const ngraph::onnx_import::Node& node); +std::string get_error_msg_prefix(const ov::frontend::onnx::Node& node); OPENVINO_SUPPRESS_DEPRECATED_END } // namespace detail @@ -26,7 +26,7 @@ class OnnxNodeValidationFailure : public ov::AssertFailure { OPENVINO_SUPPRESS_DEPRECATED_START [[noreturn]] static void create(const char* file, int line, const char* check_string, - const ngraph::onnx_import::Node& node, + const ov::frontend::onnx::Node& node, const std::string& explanation); OPENVINO_SUPPRESS_DEPRECATED_END @@ -36,7 +36,7 @@ class OnnxNodeValidationFailure : public ov::AssertFailure { OPENVINO_SUPPRESS_DEPRECATED_START struct invalid_external_data : ov::Exception { - invalid_external_data(const ngraph::onnx_import::detail::TensorExternalData& external_data) + invalid_external_data(const ov::frontend::onnx::detail::TensorExternalData& external_data) : ov::Exception{std::string{"invalid external data: "} + external_data.to_string()} {} invalid_external_data(const std::string& what_arg) : ov::Exception{what_arg} {} }; @@ -46,13 +46,15 @@ OPENVINO_SUPPRESS_DEPRECATED_END } // namespace frontend } // namespace ov -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace error { using namespace ov::frontend::onnx_error; } // namespace error -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov #define CHECK_VALID_NODE(node_, cond_, ...) \ OPENVINO_ASSERT_HELPER(ov::frontend::onnx_error::OnnxNodeValidationFailure, (node_), (cond_), ##__VA_ARGS__) diff --git a/src/frontends/onnx/frontend/src/frontend.cpp b/src/frontends/onnx/frontend/src/frontend.cpp index d32c79568e1a52..27ccd18a5f757c 100644 --- a/src/frontends/onnx/frontend/src/frontend.cpp +++ b/src/frontends/onnx/frontend/src/frontend.cpp @@ -118,7 +118,7 @@ void FrontEnd::normalize(const std::shared_ptr& model) const { std::shared_ptr FrontEnd::convert(const InputModel::Ptr& model) const { const auto partially_converted = convert_partially(model); - const auto error_message = ngraph::onnx_import::common::collect_translation_exceptions(partially_converted); + const auto error_message = ov::frontend::onnx::common::collect_translation_exceptions(partially_converted); FRONT_END_GENERAL_CHECK(error_message.empty(), error_message); normalize(partially_converted); @@ -127,7 +127,7 @@ std::shared_ptr FrontEnd::convert(const InputModel::Ptr& model) const } void FrontEnd::convert(const std::shared_ptr& partially_converted) const { - ngraph::onnx_import::detail::convert_decoded_model(partially_converted); + ov::frontend::onnx::detail::convert_decoded_model(partially_converted); normalize(partially_converted); } diff --git a/src/frontends/onnx/frontend/src/input_model.cpp b/src/frontends/onnx/frontend/src/input_model.cpp index ae24f22b3fc84d..aa367b5c5ecf6f 100644 --- a/src/frontends/onnx/frontend/src/input_model.cpp +++ b/src/frontends/onnx/frontend/src/input_model.cpp @@ -12,25 +12,22 @@ using namespace ov; using namespace ov::frontend::onnx; -OPENVINO_SUPPRESS_DEPRECATED_START - InputModel::InputModel(const std::string& path, const bool enable_mmap, frontend::ExtensionHolder extensions) - : m_editor{std::make_shared(path, enable_mmap, std::move(extensions))} {} + : m_editor{std::make_shared(path, enable_mmap, std::move(extensions))} {} #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) InputModel::InputModel(const std::wstring& path, const bool enable_mmap, frontend::ExtensionHolder extensions) - : m_editor{std::make_shared(path, enable_mmap, std::move(extensions))} {} + : m_editor{std::make_shared(path, enable_mmap, std::move(extensions))} {} #endif InputModel::InputModel(std::istream& model_stream, const bool enable_mmap, frontend::ExtensionHolder extensions) - : m_editor{std::make_shared(model_stream, "", enable_mmap, std::move(extensions))} {} + : m_editor{std::make_shared(model_stream, "", enable_mmap, std::move(extensions))} {} InputModel::InputModel(std::istream& model_stream, const std::string& path, const bool enable_mmap, frontend::ExtensionHolder extensions) - : m_editor{std::make_shared(model_stream, path, enable_mmap, std::move(extensions))} { -} + : m_editor{std::make_shared(model_stream, path, enable_mmap, std::move(extensions))} {} #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT InputModel::InputModel(std::istream& model_stream, @@ -69,8 +66,8 @@ ov::frontend::Place::Ptr InputModel::get_place_by_tensor_name(const std::string& ov::frontend::Place::Ptr InputModel::get_place_by_operation_name(const std::string& operation_name) const { if (m_editor->is_correct_and_unambiguous_node(operation_name)) { - const auto node_index = m_editor->get_node_index(onnx_editor::EditorNode{operation_name}); - onnx_editor::EditorNode node{node_index}; + const auto node_index = m_editor->get_node_index(EditorNode{operation_name}); + EditorNode node{node_index}; node.m_node_name = operation_name; return std::make_shared(node, m_editor); } @@ -340,8 +337,8 @@ void InputModel::override_all_inputs(const std::vector void InputModel::extract_subgraph(const std::vector& inputs, const std::vector& outputs) { - std::vector onnx_inputs = convert_place_to_input_edge(inputs); - std::vector onnx_outputs = convert_place_to_output_edge(outputs); + std::vector onnx_inputs = convert_place_to_input_edge(inputs); + std::vector onnx_outputs = convert_place_to_output_edge(outputs); m_editor->extract_subgraph(onnx_inputs, onnx_outputs); } @@ -442,9 +439,8 @@ void InputModel::set_tensor_value(const ov::frontend::Place::Ptr& place, const v } } -std::vector InputModel::convert_place_to_input_edge( - const std::vector& inputs) { - std::vector onnx_inputs; +std::vector InputModel::convert_place_to_input_edge(const std::vector& inputs) { + std::vector onnx_inputs; onnx_inputs.reserve(inputs.size()); for (const auto& input : inputs) { if (const auto input_port = std::dynamic_pointer_cast(input)) { @@ -456,7 +452,7 @@ std::vector InputModel::convert_place_to_input_edge( std::transform(std::begin(consumers), std::end(consumers), std::back_inserter(onnx_inputs), - [](const onnx_editor::InputEdge& edge) { + [](const InputEdge& edge) { return edge; }); } else if (const auto op = std::dynamic_pointer_cast(input)) { @@ -469,7 +465,7 @@ std::vector InputModel::convert_place_to_input_edge( std::end(op_inputs), std::back_inserter(onnx_inputs), [&node_idx, &port_idx](const std::string&) { - return onnx_editor::InputEdge{node_idx, port_idx++}; + return InputEdge{node_idx, port_idx++}; }); } } @@ -477,9 +473,8 @@ std::vector InputModel::convert_place_to_input_edge( return onnx_inputs; } -std::vector InputModel::convert_place_to_output_edge( - const std::vector& outputs) { - std::vector onnx_outputs; +std::vector InputModel::convert_place_to_output_edge(const std::vector& outputs) { + std::vector onnx_outputs; onnx_outputs.reserve(outputs.size()); for (const auto& output : outputs) { if (const auto output_port = std::dynamic_pointer_cast(output)) { @@ -501,7 +496,7 @@ std::vector InputModel::convert_place_to_output_edge( std::end(op_outputs), std::back_inserter(onnx_outputs), [&node_idx, &port_idx](const std::string&) { - return onnx_editor::OutputEdge{node_idx, port_idx++}; + return OutputEdge{node_idx, port_idx++}; }); } } diff --git a/src/frontends/onnx/frontend/src/input_model.hpp b/src/frontends/onnx/frontend/src/input_model.hpp index 803766ae25af8c..eeba81b8cbd7c2 100644 --- a/src/frontends/onnx/frontend/src/input_model.hpp +++ b/src/frontends/onnx/frontend/src/input_model.hpp @@ -78,13 +78,11 @@ class InputModel : public ov::frontend::InputModel { void set_tensor_value(const ov::frontend::Place::Ptr& place, const void* value) override; // internal usage - std::vector convert_place_to_input_edge( - const std::vector& inputs); - std::vector convert_place_to_output_edge( - const std::vector& outputs); + std::vector convert_place_to_input_edge(const std::vector& inputs); + std::vector convert_place_to_output_edge(const std::vector& outputs); private: - std::shared_ptr m_editor; + std::shared_ptr m_editor; bool is_correct_place(const ov::frontend::Place::Ptr& place) const; std::unordered_map> m_additional_tensor_names; diff --git a/src/frontends/onnx/frontend/src/node_context.cpp b/src/frontends/onnx/frontend/src/node_context.cpp index 8ea1e9a0b4ddef..4e6bc7a426f272 100644 --- a/src/frontends/onnx/frontend/src/node_context.cpp +++ b/src/frontends/onnx/frontend/src/node_context.cpp @@ -6,8 +6,7 @@ #include #include -OPENVINO_SUPPRESS_DEPRECATED_START -ov::frontend::onnx::NodeContext::NodeContext(const ngraph::onnx_import::Node& context) +ov::frontend::onnx::NodeContext::NodeContext(const ov::frontend::onnx::Node& context) : ov::frontend::NodeContext(context.op_type()), m_context(context), m_inputs(context.get_ng_inputs()) {} @@ -19,7 +18,7 @@ ov::Output ov::frontend::onnx::NodeContext::get_input(int port_idx) co ov::Any ov::frontend::onnx::NodeContext::get_attribute_as_any(const std::string& name) const { try { return m_context.get_attribute_value(name); - } catch (ngraph::onnx_import::error::node::UnknownAttribute&) { + } catch (ov::frontend::onnx::error::node::UnknownAttribute&) { return ov::Any(); } } @@ -31,16 +30,15 @@ size_t ov::frontend::onnx::NodeContext::get_input_size() const { ov::Any ov::frontend::onnx::NodeContext::apply_additional_conversion_rules(const ov::Any& data, const std::type_info& type_info) const { if (data.is() && type_info == typeid(ov::element::Type)) { - return ngraph::onnx_import::common::get_ov_element_type(data.as()); + return ov::frontend::onnx::common::get_ov_element_type(data.as()); } else if (data.is>() && type_info == typeid(std::vector)) { const auto& casted = data.as>(); std::vector types(casted.size()); for (size_t i = 0; i < casted.size(); ++i) { - types[i] = ngraph::onnx_import::common::get_ov_element_type(casted[i]); + types[i] = ov::frontend::onnx::common::get_ov_element_type(casted[i]); } return types; } // no conversion rules found return data; } -OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/onnx/frontend/src/onnx_framework_node.cpp b/src/frontends/onnx/frontend/src/onnx_framework_node.cpp index 5af271e2794be4..0a3f148983cac1 100644 --- a/src/frontends/onnx/frontend/src/onnx_framework_node.cpp +++ b/src/frontends/onnx/frontend/src/onnx_framework_node.cpp @@ -16,8 +16,9 @@ #include "onnx_framework_node.hpp" -namespace ngraph { +namespace ov { namespace frontend { +namespace onnx { std::shared_ptr ONNXFrameworkNode::clone_with_new_inputs(const ov::OutputVector& inputs) const { return std::make_shared(m_node, inputs); } @@ -45,5 +46,6 @@ bool NotSupportedONNXNode::visit_attributes(ov::AttributeVisitor& visitor) { return true; } +} // namespace onnx } // namespace frontend -} // namespace ngraph +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/onnx_framework_node.hpp b/src/frontends/onnx/frontend/src/onnx_framework_node.hpp index 2aee7b83b9197b..e3f5f3f2fb4789 100644 --- a/src/frontends/onnx/frontend/src/onnx_framework_node.hpp +++ b/src/frontends/onnx/frontend/src/onnx_framework_node.hpp @@ -26,20 +26,18 @@ namespace ONNX_NAMESPACE { class ModelProto; } // namespace ONNX_NAMESPACE -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { class Model; -} -namespace frontend { -OPENVINO_SUPPRESS_DEPRECATED_START class ONNXFrameworkNode : public ov::op::util::FrameworkNode { public: OPENVINO_OP("ONNXFrameworkNode", "util", ov::op::util::FrameworkNode); - ONNXFrameworkNode(const onnx_import::Node& node) : ONNXFrameworkNode(node, node.get_ng_inputs()) {} + ONNXFrameworkNode(const ov::frontend::onnx::Node& node) : ONNXFrameworkNode(node, node.get_ng_inputs()) {} - ONNXFrameworkNode(const onnx_import::Node& node, const ov::OutputVector& inputs) + ONNXFrameworkNode(const ov::frontend::onnx::Node& node, const ov::OutputVector& inputs) : ov::op::util::FrameworkNode(inputs, node.get_outputs_size()), m_node(node) { ov::op::util::FrameworkNodeAttrs attrs; @@ -48,7 +46,7 @@ class ONNXFrameworkNode : public ov::op::util::FrameworkNode { set_attrs(attrs); } - ov::OutputVector get_ov_nodes(const std::shared_ptr& graph) const { + ov::OutputVector get_ov_nodes(const std::shared_ptr& graph) const { ov::OutputVector ov_nodes{graph->make_ov_nodes(m_node)}; if (ov_nodes.size() > get_output_size()) { ov_nodes.resize(get_output_size()); @@ -68,14 +66,14 @@ class ONNXFrameworkNode : public ov::op::util::FrameworkNode { } protected: - onnx_import::Node m_node; + ov::frontend::onnx::Node m_node; }; class ONNXSubgraphFrameworkNode : public ONNXFrameworkNode { public: OPENVINO_OP("ONNXSubgraphFrameworkNode", "util", ONNXFrameworkNode); - ONNXSubgraphFrameworkNode(const onnx_import::Node& node, + ONNXSubgraphFrameworkNode(const ov::frontend::onnx::Node& node, const std::vector>& models, const ov::OutputVector& inputs) : ONNXFrameworkNode(node, inputs), @@ -95,9 +93,8 @@ class ONNXSubgraphFrameworkNode : public ONNXFrameworkNode { private: std::vector> m_models; }; -OPENVINO_SUPPRESS_DEPRECATED_END -// Be careful with using protobuf references (also onnx_import::Node) inside NotSupportedONNXNode +// Be careful with using protobuf references (also ov::frontend::onnx::Node) inside NotSupportedONNXNode // which are inserted into ov::Model due to different lifetime and problematic sharing between dynamic libs. class NotSupportedONNXNode : public ov::op::util::FrameworkNode { static constexpr const char* failed_conversion_key = "onnx::NotSupportedONNXNode::failed_conversion_key"; @@ -127,5 +124,6 @@ class NotSupportedONNXNode : public ov::op::util::FrameworkNode { virtual bool visit_attributes(ov::AttributeVisitor& visitor) override; }; +} // namespace onnx } // namespace frontend -} // namespace ngraph +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/abs.hpp b/src/frontends/onnx/frontend/src/op/abs.hpp index ac9e543d2645ff..99ff2d2426ecd5 100644 --- a/src/frontends/onnx/frontend/src/op/abs.hpp +++ b/src/frontends/onnx/frontend/src/op/abs.hpp @@ -4,18 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "exceptions.hpp" #include "openvino/op/abs.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector abs(const Node& node) { +inline ov::OutputVector abs(const ov::frontend::onnx::Node& node) { CHECK_VALID_NODE(node, !node.has_attribute("consumed_inputs"), "consumed_inputs legacy attribute of Abs op is not supported"); @@ -30,10 +28,7 @@ using set_1::abs; namespace set_13 { using set_6::abs; } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/acos.hpp b/src/frontends/onnx/frontend/src/op/acos.hpp index f51b19fe30d4c8..ab6dcff4c00687 100644 --- a/src/frontends/onnx/frontend/src/op/acos.hpp +++ b/src/frontends/onnx/frontend/src/op/acos.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/acos.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_7 { -inline ov::OutputVector acos(const Node& node) { +inline ov::OutputVector acos(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_7 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/acosh.hpp b/src/frontends/onnx/frontend/src/op/acosh.hpp index f8b75112f26762..4ab7edfc4d0b1c 100644 --- a/src/frontends/onnx/frontend/src/op/acosh.hpp +++ b/src/frontends/onnx/frontend/src/op/acosh.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/acosh.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_9 { -inline ov::OutputVector acosh(const Node& node) { +inline ov::OutputVector acosh(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_9 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp b/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp index ee11de0e02cb56..765e57c6a5a191 100644 --- a/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp +++ b/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp @@ -9,13 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { - -ov::OutputVector adaptive_avg_pooling2d(const Node& node) { +ov::OutputVector adaptive_avg_pooling2d(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); const auto num_inputs = inputs.size(); @@ -26,6 +25,6 @@ ov::OutputVector adaptive_avg_pooling2d(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.hpp b/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.hpp index e806f8e657673f..b7c3fc8b9b06c7 100644 --- a/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.hpp +++ b/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.hpp @@ -3,18 +3,16 @@ // #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector adaptive_avg_pooling2d(const Node& node); +ov::OutputVector adaptive_avg_pooling2d(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/add.cpp b/src/frontends/onnx/frontend/src/op/add.cpp index 853c11d21eda78..6c48873fc4be96 100644 --- a/src/frontends/onnx/frontend/src/op/add.cpp +++ b/src/frontends/onnx/frontend/src/op/add.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector add(const Node& node) { +ov::OutputVector add(const ov::frontend::onnx::Node& node) { CHECK_VALID_NODE(node, !node.has_attribute("consumed_inputs"), "consumed_inputs legacy attribute of Add op is not supported"); @@ -24,20 +24,17 @@ ov::OutputVector add(const Node& node) { } // namespace set_1 namespace set_6 { -ov::OutputVector add(const Node& node) { +ov::OutputVector add(const ov::frontend::onnx::Node& node) { return common::handle_opset6_binary_op(node); } } // namespace set_6 namespace set_7 { -ov::OutputVector add(const Node& node) { +ov::OutputVector add(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_7 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/add.hpp b/src/frontends/onnx/frontend/src/op/add.hpp index c516542a2c95b5..ab84790178d8da 100644 --- a/src/frontends/onnx/frontend/src/op/add.hpp +++ b/src/frontends/onnx/frontend/src/op/add.hpp @@ -4,26 +4,24 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector add(const Node& node); +ov::OutputVector add(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_6 { -ov::OutputVector add(const Node& node); +ov::OutputVector add(const ov::frontend::onnx::Node& node); } // namespace set_6 namespace set_7 { -ov::OutputVector add(const Node& node); +ov::OutputVector add(const ov::frontend::onnx::Node& node); } // namespace set_7 @@ -34,10 +32,7 @@ using set_7::add; namespace set_14 { using set_13::add; } // namespace set_14 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/affine.cpp b/src/frontends/onnx/frontend/src/op/affine.cpp index c6c2de23c55f08..a4c9b1e94e6b58 100644 --- a/src/frontends/onnx/frontend/src/op/affine.cpp +++ b/src/frontends/onnx/frontend/src/op/affine.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector affine(const Node& node) { +ov::OutputVector affine(const ov::frontend::onnx::Node& node) { // Affine is an obsolete experimental ONNX operation. // It takes one input tensor and produces one output tensor where // the affine function, y = alpha * x + beta, is applied to the input @@ -34,10 +34,7 @@ ov::OutputVector affine(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/affine.hpp b/src/frontends/onnx/frontend/src/op/affine.hpp index 4535a772fb239f..7b0f15743fe7f4 100644 --- a/src/frontends/onnx/frontend/src/op/affine.hpp +++ b/src/frontends/onnx/frontend/src/op/affine.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector affine(const Node& node); +ov::OutputVector affine(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/and.hpp b/src/frontends/onnx/frontend/src/op/and.hpp index 2e9eae6490f23e..41233c4759bfec 100644 --- a/src/frontends/onnx/frontend/src/op/and.hpp +++ b/src/frontends/onnx/frontend/src/op/and.hpp @@ -4,28 +4,25 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/logical_and.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector logical_and(const Node& node) { +inline ov::OutputVector logical_and(const ov::frontend::onnx::Node& node) { return common::handle_opset6_binary_op(node); } } // namespace set_1 namespace set_7 { -inline ov::OutputVector logical_and(const Node& node) { +inline ov::OutputVector logical_and(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_7 - } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/argmax.cpp b/src/frontends/onnx/frontend/src/op/argmax.cpp index cd04b737c782b7..8a6c414a4cd0e6 100644 --- a/src/frontends/onnx/frontend/src/op/argmax.cpp +++ b/src/frontends/onnx/frontend/src/op/argmax.cpp @@ -7,12 +7,12 @@ #include "exceptions.hpp" #include "utils/arg_min_max_factory.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector argmax(const Node& node) { +ov::OutputVector argmax(const ov::frontend::onnx::Node& node) { const utils::ArgMinMaxFactory arg_factory(node); return {arg_factory.make_arg_max()}; } @@ -20,16 +20,13 @@ ov::OutputVector argmax(const Node& node) { } // namespace set_1 namespace set_12 { -ov::OutputVector argmax(const Node& node) { +ov::OutputVector argmax(const ov::frontend::onnx::Node& node) { const utils::ArgMinMaxFactory arg_factory(node); return {arg_factory.make_arg_max()}; } } // namespace set_12 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/argmax.hpp b/src/frontends/onnx/frontend/src/op/argmax.hpp index 6fd7c27a4f1386..380c7297f7c8e2 100644 --- a/src/frontends/onnx/frontend/src/op/argmax.hpp +++ b/src/frontends/onnx/frontend/src/op/argmax.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Convert ONNX ArgMax operation to an OV node. @@ -19,7 +17,7 @@ namespace set_1 { /// /// \return The vector containing an OV node which produces the output /// of an ONNX ArgMax operation. -ov::OutputVector argmax(const Node& node); +ov::OutputVector argmax(const ov::frontend::onnx::Node& node); } // namespace set_1 @@ -30,13 +28,10 @@ namespace set_12 { /// /// \return The vector containing an OV node which produces the output /// of an ONNX ArgMax operation. -ov::OutputVector argmax(const Node& node); +ov::OutputVector argmax(const ov::frontend::onnx::Node& node); } // namespace set_12 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/argmin.cpp b/src/frontends/onnx/frontend/src/op/argmin.cpp index cf5074d89ba284..a2ed93569c07ff 100644 --- a/src/frontends/onnx/frontend/src/op/argmin.cpp +++ b/src/frontends/onnx/frontend/src/op/argmin.cpp @@ -7,12 +7,12 @@ #include "exceptions.hpp" #include "utils/arg_min_max_factory.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector argmin(const Node& node) { +ov::OutputVector argmin(const ov::frontend::onnx::Node& node) { const utils::ArgMinMaxFactory arg_factory(node); return {arg_factory.make_arg_min()}; } @@ -20,16 +20,13 @@ ov::OutputVector argmin(const Node& node) { } // namespace set_1 namespace set_12 { -ov::OutputVector argmin(const Node& node) { +ov::OutputVector argmin(const ov::frontend::onnx::Node& node) { const utils::ArgMinMaxFactory arg_factory(node); return {arg_factory.make_arg_min()}; } } // namespace set_12 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/argmin.hpp b/src/frontends/onnx/frontend/src/op/argmin.hpp index 62c148aa85fd62..25712fd1d49626 100644 --- a/src/frontends/onnx/frontend/src/op/argmin.hpp +++ b/src/frontends/onnx/frontend/src/op/argmin.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Convert ONNX ArgMin operation to an OV node. @@ -19,7 +17,7 @@ namespace set_1 { /// /// \return The vector containing an OV node which produces the output /// of an ONNX ArgMin operation. -ov::OutputVector argmin(const Node& node); +ov::OutputVector argmin(const ov::frontend::onnx::Node& node); } // namespace set_1 @@ -30,13 +28,10 @@ namespace set_12 { /// /// \return The vector containing an OV node which produces the output /// of an ONNX ArgMax operation. -ov::OutputVector argmin(const Node& node); +ov::OutputVector argmin(const ov::frontend::onnx::Node& node); } // namespace set_12 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/asin.hpp b/src/frontends/onnx/frontend/src/op/asin.hpp index bbfcc2715f873b..2e01dbf50836af 100644 --- a/src/frontends/onnx/frontend/src/op/asin.hpp +++ b/src/frontends/onnx/frontend/src/op/asin.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/asin.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector asin(const Node& node) { +inline ov::OutputVector asin(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/asinh.hpp b/src/frontends/onnx/frontend/src/op/asinh.hpp index 52a8e44e87ef9e..d7826983b5142c 100644 --- a/src/frontends/onnx/frontend/src/op/asinh.hpp +++ b/src/frontends/onnx/frontend/src/op/asinh.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/asinh.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector asinh(const Node& node) { +inline ov::OutputVector asinh(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/atan.hpp b/src/frontends/onnx/frontend/src/op/atan.hpp index 72ae701b6b992d..38eb77db3dc786 100644 --- a/src/frontends/onnx/frontend/src/op/atan.hpp +++ b/src/frontends/onnx/frontend/src/op/atan.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/atan.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector atan(const Node& node) { +inline ov::OutputVector atan(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/atanh.hpp b/src/frontends/onnx/frontend/src/op/atanh.hpp index 65a71a8ce60675..8c04ac1f43ff9c 100644 --- a/src/frontends/onnx/frontend/src/op/atanh.hpp +++ b/src/frontends/onnx/frontend/src/op/atanh.hpp @@ -4,23 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/atanh.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector atanh(const Node& node) { +inline ov::OutputVector atanh(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/aten.cpp b/src/frontends/onnx/frontend/src/op/aten.cpp index 6e3de7a83fab1f..20830eb174efe1 100644 --- a/src/frontends/onnx/frontend/src/op/aten.cpp +++ b/src/frontends/onnx/frontend/src/op/aten.cpp @@ -19,13 +19,13 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector aten(const Node& node) { +ov::OutputVector aten(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; const auto operator_name = node.get_attribute_value("operator", ""); @@ -98,6 +98,6 @@ ov::OutputVector aten(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/aten.hpp b/src/frontends/onnx/frontend/src/op/aten.hpp index b8b90737085b69..2393eb0fc152f7 100644 --- a/src/frontends/onnx/frontend/src/op/aten.hpp +++ b/src/frontends/onnx/frontend/src/op/aten.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector aten(const Node& node); +ov::OutputVector aten(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/average_pool.cpp b/src/frontends/onnx/frontend/src/op/average_pool.cpp index bc646c83ddd0b6..5e731ab8580e46 100644 --- a/src/frontends/onnx/frontend/src/op/average_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/average_pool.cpp @@ -6,20 +6,17 @@ #include "utils/pooling_factory.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector average_pool(const Node& node) { +ov::OutputVector average_pool(const ov::frontend::onnx::Node& node) { return pooling::PoolingFactory(node).make_avg_pool(); } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/average_pool.hpp b/src/frontends/onnx/frontend/src/op/average_pool.hpp index b08deccadc92b8..c80aa54517b99b 100644 --- a/src/frontends/onnx/frontend/src/op/average_pool.hpp +++ b/src/frontends/onnx/frontend/src/op/average_pool.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Convert ONNX AveragePool operation to an OV node. @@ -19,13 +17,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX AveragePool /// operation. -ov::OutputVector average_pool(const Node& node); +ov::OutputVector average_pool(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/batch_norm.cpp b/src/frontends/onnx/frontend/src/op/batch_norm.cpp index 2f8493fc6a2261..628d74bb782f7c 100644 --- a/src/frontends/onnx/frontend/src/op/batch_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/batch_norm.cpp @@ -13,13 +13,13 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { // This version supports ONNX BatchNormalization-1 and BatchNormalization-6 -ov::OutputVector batch_norm(const Node& node) { +ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; auto x = inputs.at(0); auto scale = inputs.at(1); @@ -55,7 +55,7 @@ ov::OutputVector batch_norm(const Node& node) { namespace set_7 { // This version supports ONNX BatchNormalization-7 and BatchNormalization-9 -ov::OutputVector batch_norm(const Node& node) { +ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; auto x = inputs.at(0); auto scale = inputs.at(1); @@ -73,10 +73,7 @@ ov::OutputVector batch_norm(const Node& node) { } } // namespace set_7 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/batch_norm.hpp b/src/frontends/onnx/frontend/src/op/batch_norm.hpp index c3263c5f436537..f060b740eb0fad 100644 --- a/src/frontends/onnx/frontend/src/op/batch_norm.hpp +++ b/src/frontends/onnx/frontend/src/op/batch_norm.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector batch_norm(const Node& node); +ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_7 { -ov::OutputVector batch_norm(const Node& node); +ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node); } // namespace set_7 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitshift.cpp b/src/frontends/onnx/frontend/src/op/bitshift.cpp index afc942242d0fe6..95846036391f13 100644 --- a/src/frontends/onnx/frontend/src/op/bitshift.cpp +++ b/src/frontends/onnx/frontend/src/op/bitshift.cpp @@ -12,12 +12,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitshift(const Node& node) { +ov::OutputVector bitshift(const ov::frontend::onnx::Node& node) { const ov::Output input_x = node.get_ng_inputs().at(0); const ov::Output input_y = node.get_ng_inputs().at(1); @@ -42,10 +42,7 @@ ov::OutputVector bitshift(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitshift.hpp b/src/frontends/onnx/frontend/src/op/bitshift.hpp index c1b0fcdceb5329..6450a88bf22b30 100644 --- a/src/frontends/onnx/frontend/src/op/bitshift.hpp +++ b/src/frontends/onnx/frontend/src/op/bitshift.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitshift(const Node& node); +ov::OutputVector bitshift(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_and.cpp b/src/frontends/onnx/frontend/src/op/bitwise_and.cpp index d13ea78c249dde..bc0db6a6a10ce7 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_and.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_and.cpp @@ -3,22 +3,23 @@ // #include "op/bitwise_and.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START #include "openvino/op/bitwise_and.hpp" using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_and(const Node& node) { +ov::OutputVector bitwise_and(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); OPENVINO_ASSERT(inputs.size() == 2); return {std::make_shared(inputs[0], inputs[1])}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_and.hpp b/src/frontends/onnx/frontend/src/op/bitwise_and.hpp index 8c86cbd8160d78..5b30fe5adf76a2 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_and.hpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_and.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_and(const Node& node); +ov::OutputVector bitwise_and(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_not.cpp b/src/frontends/onnx/frontend/src/op/bitwise_not.cpp index d59e4593e1aa09..3340c453a389e1 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_not.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_not.cpp @@ -3,23 +3,23 @@ // #include "op/bitwise_not.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START #include "openvino/op/bitwise_not.hpp" using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_not(const Node& node) { +ov::OutputVector bitwise_not(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); OPENVINO_ASSERT(inputs.size() == 1); return {std::make_shared(inputs[0])}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_not.hpp b/src/frontends/onnx/frontend/src/op/bitwise_not.hpp index c70a3658e4df6f..e1ac92a436dc6f 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_not.hpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_not.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_not(const Node& node); +ov::OutputVector bitwise_not(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_or.cpp b/src/frontends/onnx/frontend/src/op/bitwise_or.cpp index 7a7b6a415825a0..33100e35a46949 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_or.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_or.cpp @@ -3,22 +3,23 @@ // #include "op/bitwise_or.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START #include "openvino/op/bitwise_or.hpp" using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_or(const Node& node) { +ov::OutputVector bitwise_or(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); OPENVINO_ASSERT(inputs.size() == 2); return {std::make_shared(inputs[0], inputs[1])}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_or.hpp b/src/frontends/onnx/frontend/src/op/bitwise_or.hpp index bcb71fb696daf2..7bee82aacc24d7 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_or.hpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_or.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_or(const Node& node); +ov::OutputVector bitwise_or(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp b/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp index 8eed1800cece3e..5ab5abef662947 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp @@ -3,22 +3,23 @@ // #include "op/bitwise_xor.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START #include "openvino/op/bitwise_xor.hpp" using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_xor(const Node& node) { +ov::OutputVector bitwise_xor(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); OPENVINO_ASSERT(inputs.size() == 2); return {std::make_shared(inputs[0], inputs[1])}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/bitwise_xor.hpp b/src/frontends/onnx/frontend/src/op/bitwise_xor.hpp index cd0ce129391e38..682082c00bc367 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_xor.hpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_xor.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bitwise_xor(const Node& node); +ov::OutputVector bitwise_xor(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp b/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp index da32d73f11314e..0d25d674d3062c 100644 --- a/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp +++ b/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp @@ -19,12 +19,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector blackmanwindow(const Node& node) { +ov::OutputVector blackmanwindow(const ov::frontend::onnx::Node& node) { const auto size = node.get_ng_inputs().at(0); const auto output_datatype = common::get_ov_element_type(node.get_attribute_value("output_datatype", 1)); const bool periodic = node.get_attribute_value("periodic", 1) == 1; @@ -78,6 +78,6 @@ ov::OutputVector blackmanwindow(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/blackmanwindow.hpp b/src/frontends/onnx/frontend/src/op/blackmanwindow.hpp index 58d4b6ea1b3055..719c75ef7b8c37 100644 --- a/src/frontends/onnx/frontend/src/op/blackmanwindow.hpp +++ b/src/frontends/onnx/frontend/src/op/blackmanwindow.hpp @@ -3,20 +3,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector blackmanwindow(const Node& node); +ov::OutputVector blackmanwindow(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cast.cpp b/src/frontends/onnx/frontend/src/op/cast.cpp index f3a4fb1c5cd9e2..4e67314f1fda38 100644 --- a/src/frontends/onnx/frontend/src/op/cast.cpp +++ b/src/frontends/onnx/frontend/src/op/cast.cpp @@ -9,13 +9,13 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cast(const Node& node) { +ov::OutputVector cast(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); int64_t target_type = node.get_attribute_value("to"); ov::element::Type elem_type = common::get_ov_element_type(target_type); @@ -25,6 +25,6 @@ ov::OutputVector cast(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cast.hpp b/src/frontends/onnx/frontend/src/op/cast.hpp index d14ea2536e7d38..313fac756e1a16 100644 --- a/src/frontends/onnx/frontend/src/op/cast.hpp +++ b/src/frontends/onnx/frontend/src/op/cast.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cast(const Node& node); +ov::OutputVector cast(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cast_like.cpp b/src/frontends/onnx/frontend/src/op/cast_like.cpp index 508b678f9fa3df..b41846537ec190 100644 --- a/src/frontends/onnx/frontend/src/op/cast_like.cpp +++ b/src/frontends/onnx/frontend/src/op/cast_like.cpp @@ -8,19 +8,19 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cast_like(const Node& node) { +ov::OutputVector cast_like(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); return {std::make_shared(inputs.at(0), inputs.at(1))}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cast_like.hpp b/src/frontends/onnx/frontend/src/op/cast_like.hpp index 06b129e816876d..aa7f65326b5e30 100644 --- a/src/frontends/onnx/frontend/src/op/cast_like.hpp +++ b/src/frontends/onnx/frontend/src/op/cast_like.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cast_like(const Node& node); +ov::OutputVector cast_like(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/ceil.hpp b/src/frontends/onnx/frontend/src/op/ceil.hpp index 2669996af3f288..cc0b11de7ba068 100644 --- a/src/frontends/onnx/frontend/src/op/ceil.hpp +++ b/src/frontends/onnx/frontend/src/op/ceil.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/ceiling.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector ceil(const Node& node) { +inline ov::OutputVector ceil(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/clip.cpp b/src/frontends/onnx/frontend/src/op/clip.cpp index 45e01fc7514918..b5afd2f2d4fe85 100644 --- a/src/frontends/onnx/frontend/src/op/clip.cpp +++ b/src/frontends/onnx/frontend/src/op/clip.cpp @@ -14,12 +14,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector clip(const Node& node) { +ov::OutputVector clip(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const double max_value = node.get_attribute_value("max", std::numeric_limits::max()); @@ -71,7 +71,7 @@ std::shared_ptr get_constant_max_of_type(ov::element::Type } } // namespace -ov::OutputVector clip(const Node& node) { +ov::OutputVector clip(const ov::frontend::onnx::Node& node) { const ov::OutputVector inputs{node.get_ng_inputs()}; const ov::Output data = inputs.at(0); const ov::element::Type data_type = data.get_element_type(); @@ -100,10 +100,7 @@ ov::OutputVector clip(const Node& node) { } } // namespace set_11 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/clip.hpp b/src/frontends/onnx/frontend/src/op/clip.hpp index 1115e3630b31c7..fb1cb1759e5069 100644 --- a/src/frontends/onnx/frontend/src/op/clip.hpp +++ b/src/frontends/onnx/frontend/src/op/clip.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector clip(const Node& node); +ov::OutputVector clip(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_11 { -ov::OutputVector clip(const Node& node); +ov::OutputVector clip(const ov::frontend::onnx::Node& node); } // namespace set_11 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp index c15059753c911f..a6d4f0c397ffeb 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp @@ -41,8 +41,9 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace detail { namespace { @@ -70,7 +71,7 @@ std::shared_ptr get_present_state(const std::shared_ptr& K, } // namespace detail namespace set_1 { -ov::OutputVector attention(const Node& node) { +ov::OutputVector attention(const ov::frontend::onnx::Node& node) { auto nodes = node.get_ng_inputs(); const auto& input = nodes[0]; const auto& weights = nodes[1]; @@ -560,5 +561,6 @@ std::shared_ptr get_present_state(const std::shared_ptr& K, } // namespace } // namespace detail } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.hpp b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.hpp index 090a364d5aa0b5..9b851563526a56 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.hpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.hpp @@ -4,17 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector attention(const Node& node); +ov::OutputVector attention(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp index 9011638b1e0ef1..d4cd878c8b4136 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp @@ -10,16 +10,18 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bias_gelu(const Node& node) { +ov::OutputVector bias_gelu(const ov::frontend::onnx::Node& node) { auto nodes = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(nodes.size() == 2, "BiasGelu takes 2 inputs. Provided " + std::to_string(nodes.size())); return {std::make_shared(std::make_shared(nodes.at(0), nodes.at(1)))}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.hpp b/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.hpp index bf4c58d0036861..6bf0ad41033a4a 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.hpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.hpp @@ -4,17 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector bias_gelu(const Node& node); +ov::OutputVector bias_gelu(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp index 40bb9adf51a870..afcae6453e137e 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp @@ -19,11 +19,12 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector embed_layer_normalization(const Node& node) { +ov::OutputVector embed_layer_normalization(const ov::frontend::onnx::Node& node) { auto nodes = node.get_ng_inputs(); auto num_nodes = nodes.size(); @@ -100,5 +101,6 @@ ov::OutputVector embed_layer_normalization(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.hpp b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.hpp index a0bc8531dea074..2106b64aadcd36 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.hpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.hpp @@ -4,17 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector embed_layer_normalization(const Node& node); +ov::OutputVector embed_layer_normalization(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp index 740980849ea78b..9ec06a638929fa 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp @@ -22,11 +22,12 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector fused_conv(const Node& node) { +ov::OutputVector fused_conv(const ov::frontend::onnx::Node& node) { auto conv_res = conv(node).at(0); if (node.get_ng_inputs().size() == 4) { // Z input provided @@ -71,9 +72,7 @@ ov::OutputVector fused_conv(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.hpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.hpp index 6083e08913ee3c..2d46fceeded4be 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.hpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.hpp @@ -4,17 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector fused_conv(const Node& node); +ov::OutputVector fused_conv(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp index 54d24c0ffd69b2..02a0b1ad3418da 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp @@ -18,11 +18,12 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector fusedgemm(const Node& node) { +ov::OutputVector fusedgemm(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; auto num_inputs = inputs.size(); FRONT_END_GENERAL_CHECK(num_inputs == 2 || num_inputs == 3, @@ -63,9 +64,7 @@ ov::OutputVector fusedgemm(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.hpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.hpp index 1c70a9beed2ee5..630a03154a2ef7 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.hpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.hpp @@ -4,17 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector fusedgemm(const Node& node); +ov::OutputVector fusedgemm(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp index bdfa07c3c7b33a..3e2db86ae21a50 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp @@ -13,11 +13,12 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector skip_layer_normalization(const Node& node) { +ov::OutputVector skip_layer_normalization(const ov::frontend::onnx::Node& node) { auto nodes = node.get_ng_inputs(); auto num_nodes = nodes.size(); FRONT_END_GENERAL_CHECK(num_nodes >= 3 && num_nodes <= 5, @@ -48,5 +49,6 @@ ov::OutputVector skip_layer_normalization(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.hpp b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.hpp index 11e19bf1bbbda6..7f54e5e9344dcf 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.hpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.hpp @@ -4,17 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector skip_layer_normalization(const Node& node); +ov::OutputVector skip_layer_normalization(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/compress.cpp b/src/frontends/onnx/frontend/src/op/compress.cpp index c13bfcd30c1b45..0a99032f63659f 100644 --- a/src/frontends/onnx/frontend/src/op/compress.cpp +++ b/src/frontends/onnx/frontend/src/op/compress.cpp @@ -13,12 +13,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector compress(const Node& node) { +ov::OutputVector compress(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); auto condition = node.get_ng_inputs().at(1); @@ -40,10 +40,7 @@ ov::OutputVector compress(const Node& node) { return {result}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/compress.hpp b/src/frontends/onnx/frontend/src/op/compress.hpp index 06b67050fc0ba3..7ea4ed5fc5a999 100644 --- a/src/frontends/onnx/frontend/src/op/compress.hpp +++ b/src/frontends/onnx/frontend/src/op/compress.hpp @@ -4,19 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector compress(const Node& node); +ov::OutputVector compress(const ov::frontend::onnx::Node& node); } } // namespace op -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/concat.cpp b/src/frontends/onnx/frontend/src/op/concat.cpp index 6c9e87daaf8ec3..06f48231466a01 100644 --- a/src/frontends/onnx/frontend/src/op/concat.cpp +++ b/src/frontends/onnx/frontend/src/op/concat.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector concat(const Node& node) { +ov::OutputVector concat(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; std::int64_t axis = node.get_attribute_value("axis"); ov::OutputVector valid_inputs; @@ -25,10 +25,7 @@ ov::OutputVector concat(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/concat.hpp b/src/frontends/onnx/frontend/src/op/concat.hpp index c0244222e2ab61..026c253c433df7 100644 --- a/src/frontends/onnx/frontend/src/op/concat.hpp +++ b/src/frontends/onnx/frontend/src/op/concat.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector concat(const Node& node); +ov::OutputVector concat(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/constant.cpp b/src/frontends/onnx/frontend/src/op/constant.cpp index fa6cef92c099d4..79a001aeefd615 100644 --- a/src/frontends/onnx/frontend/src/op/constant.cpp +++ b/src/frontends/onnx/frontend/src/op/constant.cpp @@ -15,9 +15,9 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace { template @@ -107,7 +107,7 @@ std::vector get_absolute_indices(const Tensor& indices_tensor, const ov } // namespace namespace set_1 { -ov::OutputVector constant(const onnx_import::Node& node) { +ov::OutputVector constant(const ov::frontend::onnx::Node& node) { auto tensor = node.get_attribute_value("value"); return {tensor.get_ov_constant()}; } @@ -115,7 +115,7 @@ ov::OutputVector constant(const onnx_import::Node& node) { } // namespace set_1 namespace set_13 { -ov::OutputVector constant(const onnx_import::Node& node) { +ov::OutputVector constant(const ov::frontend::onnx::Node& node) { auto attributes_names = node.get_attribute_names(); FRONT_END_GENERAL_CHECK(attributes_names.size() == 1, "The Constant op expects exactly one attribute." @@ -185,6 +185,6 @@ ov::OutputVector constant(const onnx_import::Node& node) { } } // namespace set_13 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/constant.hpp b/src/frontends/onnx/frontend/src/op/constant.hpp index 4106a2d32814fb..d5f9e0e9ab58c7 100644 --- a/src/frontends/onnx/frontend/src/op/constant.hpp +++ b/src/frontends/onnx/frontend/src/op/constant.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector constant(const Node& node); +ov::OutputVector constant(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_13 { -ov::OutputVector constant(const Node& node); +ov::OutputVector constant(const ov::frontend::onnx::Node& node); } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/constant_fill.cpp b/src/frontends/onnx/frontend/src/op/constant_fill.cpp index f800d0c876fbb4..611a0def8981d8 100644 --- a/src/frontends/onnx/frontend/src/op/constant_fill.cpp +++ b/src/frontends/onnx/frontend/src/op/constant_fill.cpp @@ -6,6 +6,8 @@ #include // onnx types +using namespace ::ONNX_NAMESPACE; + #include "exceptions.hpp" #include "onnx_common/utils.hpp" #include "openvino/op/broadcast.hpp" @@ -14,12 +16,12 @@ using namespace ov::op; using namespace ov::frontend::onnx::common; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector constant_fill(const Node& node) { +ov::OutputVector constant_fill(const ov::frontend::onnx::Node& node) { ov::Output target_shape; const auto dtype = node.get_attribute_value("dtype", static_cast(TensorProto_DataType_FLOAT)); const auto ng_type = onnx_to_ov_data_type(static_cast(dtype)); @@ -46,7 +48,6 @@ ov::OutputVector constant_fill(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/constant_fill.hpp b/src/frontends/onnx/frontend/src/op/constant_fill.hpp index 48c14bd170a67d..ddd1f7a230dc0f 100644 --- a/src/frontends/onnx/frontend/src/op/constant_fill.hpp +++ b/src/frontends/onnx/frontend/src/op/constant_fill.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { // ConstantFill is a deprecated experimental operator removed in ONNX 1.4 -ov::OutputVector constant_fill(const Node& node); +ov::OutputVector constant_fill(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp b/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp index 49ef373b9025e4..353a339fff1771 100644 --- a/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp +++ b/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp @@ -14,12 +14,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector constant_of_shape(const onnx_import::Node& node) { +ov::OutputVector constant_of_shape(const ov::frontend::onnx::Node& node) { ov::Output constant_value; if (node.has_attribute("value")) { auto value_tensor = node.get_attribute_value("value"); @@ -37,10 +37,7 @@ ov::OutputVector constant_of_shape(const onnx_import::Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/constant_of_shape.hpp b/src/frontends/onnx/frontend/src/op/constant_of_shape.hpp index 93f61d4825494a..41c82fdee90009 100644 --- a/src/frontends/onnx/frontend/src/op/constant_of_shape.hpp +++ b/src/frontends/onnx/frontend/src/op/constant_of_shape.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector constant_of_shape(const Node& node); +ov::OutputVector constant_of_shape(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/conv.cpp b/src/frontends/onnx/frontend/src/op/conv.cpp index 32deeb8a5555fe..2dc46ce108f043 100644 --- a/src/frontends/onnx/frontend/src/op/conv.cpp +++ b/src/frontends/onnx/frontend/src/op/conv.cpp @@ -13,11 +13,11 @@ #include "utils/convpool.hpp" #include "utils/reshape.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { namespace detail { @@ -29,7 +29,7 @@ std::shared_ptr add_bias(const ov::Output& ng_conv, const ov return {std::make_shared(ng_conv, reshape::reshape_channel_shaped_node_to_nchw(bias, conv_rank))}; } -ov::OutputVector conv(const Node& node, +ov::OutputVector conv(const ov::frontend::onnx::Node& node, ov::Output data, ov::Output filters, ov::Output bias) { @@ -72,15 +72,12 @@ ov::OutputVector conv(const Node& node, } } // namespace detail -ov::OutputVector conv(const Node& node) { +ov::OutputVector conv(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); return detail::conv(node, inputs[0], inputs[1], inputs.size() < 3 ? std::make_shared() : inputs[2]); } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/conv.hpp b/src/frontends/onnx/frontend/src/op/conv.hpp index e9ac179a27899a..9882758056ad7b 100644 --- a/src/frontends/onnx/frontend/src/op/conv.hpp +++ b/src/frontends/onnx/frontend/src/op/conv.hpp @@ -4,18 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { namespace detail { -ov::OutputVector conv(const Node& node, +ov::OutputVector conv(const ov::frontend::onnx::Node& node, ov::Output data, ov::Output filters, ov::Output bias); @@ -26,13 +24,10 @@ ov::OutputVector conv(const Node& node, /// /// \return The vector containing OV nodes producing output of ONNX convolution /// operation. -ov::OutputVector conv(const Node& node); +ov::OutputVector conv(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/conv_integer.cpp b/src/frontends/onnx/frontend/src/op/conv_integer.cpp index b729e00cfd4e1b..9ad85769bbb792 100644 --- a/src/frontends/onnx/frontend/src/op/conv_integer.cpp +++ b/src/frontends/onnx/frontend/src/op/conv_integer.cpp @@ -16,9 +16,9 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace { std::shared_ptr get_filter_zero_point(const ov::OutputVector& inputs) { const auto& original_zero_point = @@ -45,7 +45,7 @@ std::shared_ptr get_filter_zero_point(const ov::OutputVector& inputs) namespace op { namespace set_1 { -ov::OutputVector conv_integer(const Node& node) { +ov::OutputVector conv_integer(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); const auto& input = inputs.at(0); @@ -82,6 +82,6 @@ ov::OutputVector conv_integer(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/conv_integer.hpp b/src/frontends/onnx/frontend/src/op/conv_integer.hpp index bbbab49881e97b..2d86bec3176f99 100644 --- a/src/frontends/onnx/frontend/src/op/conv_integer.hpp +++ b/src/frontends/onnx/frontend/src/op/conv_integer.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX ConvInteger operation. @@ -19,13 +17,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of quantized ONNX /// convolution operation. -ov::OutputVector conv_integer(const Node& node); +ov::OutputVector conv_integer(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/conv_transpose.cpp b/src/frontends/onnx/frontend/src/op/conv_transpose.cpp index e37e42e85b45fd..9bae7cf2ae299d 100644 --- a/src/frontends/onnx/frontend/src/op/conv_transpose.cpp +++ b/src/frontends/onnx/frontend/src/op/conv_transpose.cpp @@ -24,9 +24,9 @@ using ov::CoordinateDiff; using ov::Shape; using ov::Strides; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { namespace { @@ -128,7 +128,7 @@ ov::Output get_prepared_bias(const ov::Output& bias, const o } } // namespace -ov::OutputVector conv_transpose(const Node& node) { +ov::OutputVector conv_transpose(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); CHECK_VALID_NODE(node, @@ -215,10 +215,7 @@ ov::OutputVector conv_transpose(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/conv_transpose.hpp b/src/frontends/onnx/frontend/src/op/conv_transpose.hpp index 910aeba3a5f465..40e59d65c8764d 100644 --- a/src/frontends/onnx/frontend/src/op/conv_transpose.hpp +++ b/src/frontends/onnx/frontend/src/op/conv_transpose.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX Transposed Convolution operation. @@ -19,13 +17,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX convolution /// operation. -ov::OutputVector conv_transpose(const Node& node); +ov::OutputVector conv_transpose(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cos.cpp b/src/frontends/onnx/frontend/src/op/cos.cpp index e1aa371b04d94b..3fd7d09cebc5c4 100644 --- a/src/frontends/onnx/frontend/src/op/cos.cpp +++ b/src/frontends/onnx/frontend/src/op/cos.cpp @@ -8,19 +8,16 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cos(const Node& node) { +ov::OutputVector cos(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cos.hpp b/src/frontends/onnx/frontend/src/op/cos.hpp index fca9c03486eea2..039e5129649c73 100644 --- a/src/frontends/onnx/frontend/src/op/cos.hpp +++ b/src/frontends/onnx/frontend/src/op/cos.hpp @@ -4,20 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cos(const Node& node); +ov::OutputVector cos(const ov::frontend::onnx::Node& node); } } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cosh.cpp b/src/frontends/onnx/frontend/src/op/cosh.cpp index 8f291542ee978f..c0bb1ae0dbf08e 100644 --- a/src/frontends/onnx/frontend/src/op/cosh.cpp +++ b/src/frontends/onnx/frontend/src/op/cosh.cpp @@ -8,19 +8,16 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cosh(const Node& node) { +ov::OutputVector cosh(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cosh.hpp b/src/frontends/onnx/frontend/src/op/cosh.hpp index a555640a5d551b..974352d8ba416f 100644 --- a/src/frontends/onnx/frontend/src/op/cosh.hpp +++ b/src/frontends/onnx/frontend/src/op/cosh.hpp @@ -4,19 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cosh(const Node& node); +ov::OutputVector cosh(const ov::frontend::onnx::Node& node); } } // namespace op -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/crop.cpp b/src/frontends/onnx/frontend/src/op/crop.cpp index e7a938476d426f..41540e3de27925 100644 --- a/src/frontends/onnx/frontend/src/op/crop.cpp +++ b/src/frontends/onnx/frontend/src/op/crop.cpp @@ -13,12 +13,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector crop(const Node& node) { +ov::OutputVector crop(const ov::frontend::onnx::Node& node) { // Crop is an obsolete experimental ONNX operation. // Crops an image's spatial dimensions. @@ -74,10 +74,7 @@ ov::OutputVector crop(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/crop.hpp b/src/frontends/onnx/frontend/src/op/crop.hpp index 62c3c7e5207978..e9bff06481e7ab 100644 --- a/src/frontends/onnx/frontend/src/op/crop.hpp +++ b/src/frontends/onnx/frontend/src/op/crop.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector crop(const Node& node); +ov::OutputVector crop(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cum_sum.cpp b/src/frontends/onnx/frontend/src/op/cum_sum.cpp index e53913ea084fbd..38ccc631abb4cd 100644 --- a/src/frontends/onnx/frontend/src/op/cum_sum.cpp +++ b/src/frontends/onnx/frontend/src/op/cum_sum.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cum_sum(const Node& node) { +ov::OutputVector cum_sum(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); auto data = inputs.at(0); bool exclusive = node.get_attribute_value("exclusive", 0); @@ -25,7 +25,7 @@ ov::OutputVector cum_sum(const Node& node) { if (inputs.size() > 1) { // optional input, 0-D or 1-D tensor const auto& axis_shape = inputs.at(1).get_partial_shape(); - axis = axis_shape.is_dynamic() ? inputs.at(1) : ngraph::onnx_import::reshape::interpret_as_scalar(inputs.at(1)); + axis = axis_shape.is_dynamic() ? inputs.at(1) : ov::frontend::onnx::reshape::interpret_as_scalar(inputs.at(1)); } else { axis = v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); // default } @@ -33,10 +33,7 @@ ov::OutputVector cum_sum(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/cum_sum.hpp b/src/frontends/onnx/frontend/src/op/cum_sum.hpp index 34d8d6ab38687c..94ca7d0bc35110 100644 --- a/src/frontends/onnx/frontend/src/op/cum_sum.hpp +++ b/src/frontends/onnx/frontend/src/op/cum_sum.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector cum_sum(const Node& node); +ov::OutputVector cum_sum(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/depth_to_space.cpp b/src/frontends/onnx/frontend/src/op/depth_to_space.cpp index 2fccf37d7245fc..23b6210c6f1bc7 100644 --- a/src/frontends/onnx/frontend/src/op/depth_to_space.cpp +++ b/src/frontends/onnx/frontend/src/op/depth_to_space.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector depth_to_space(const Node& node) { +ov::OutputVector depth_to_space(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); const auto& shape = data.get_partial_shape(); FRONT_END_GENERAL_CHECK(shape.rank().is_static() && shape.rank().get_length() == 4, "Input must be 4-dimensional"); @@ -32,10 +32,7 @@ ov::OutputVector depth_to_space(const Node& node) { return ov::OutputVector{std::make_shared(data, ov_mode, block_size)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/depth_to_space.hpp b/src/frontends/onnx/frontend/src/op/depth_to_space.hpp index f0b8169c9cdccf..31e100cb3cca5a 100644 --- a/src/frontends/onnx/frontend/src/op/depth_to_space.hpp +++ b/src/frontends/onnx/frontend/src/op/depth_to_space.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Permutes input tensor data from depth into blocks of spatial data. @@ -22,12 +20,9 @@ namespace set_1 { /// /// \return ov::OutputVector containing Tensor with shape: /// [N, C/(blocksize * blocksize), H * blocksize, W * blocksize] -ov::OutputVector depth_to_space(const Node& node); +ov::OutputVector depth_to_space(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp index 0582235a0c34cd..7932bbef6cfd5b 100644 --- a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp @@ -19,9 +19,9 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace detail { std::shared_ptr get_zero_point(const ov::OutputVector& inputs) { @@ -38,7 +38,7 @@ std::shared_ptr get_zero_point(const ov::OutputVector& inputs) { } } // namespace detail namespace set_1 { -ov::OutputVector dequantize_linear(const Node& node) { +ov::OutputVector dequantize_linear(const ov::frontend::onnx::Node& node) { const ov::OutputVector inputs{node.get_ng_inputs()}; FRONT_END_GENERAL_CHECK(2 <= inputs.size() && inputs.size() <= 3, @@ -162,7 +162,7 @@ ov::OutputVector dequantize_linear(const ov::Output& x, } } // namespace detail -ov::OutputVector dequantize_linear(const Node& node) { +ov::OutputVector dequantize_linear(const ov::frontend::onnx::Node& node) { const ov::OutputVector inputs{node.get_ng_inputs()}; FRONT_END_GENERAL_CHECK(2 <= inputs.size() && inputs.size() <= 3, @@ -191,6 +191,6 @@ ov::OutputVector dequantize_linear(const Node& node) { } } // namespace set_13 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dequantize_linear.hpp b/src/frontends/onnx/frontend/src/op/dequantize_linear.hpp index 0d2e58e6c682c1..dffd8c7762b18d 100644 --- a/src/frontends/onnx/frontend/src/op/dequantize_linear.hpp +++ b/src/frontends/onnx/frontend/src/op/dequantize_linear.hpp @@ -4,18 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector dequantize_linear(const Node& node); +ov::OutputVector dequantize_linear(const ov::frontend::onnx::Node& node); } // namespace set_1 @@ -27,12 +25,9 @@ ov::OutputVector dequantize_linear(const ov::Output& x, int64_t axis, const Node& node); } -ov::OutputVector dequantize_linear(const Node& node); +ov::OutputVector dequantize_linear(const ov::frontend::onnx::Node& node); } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dft.cpp b/src/frontends/onnx/frontend/src/op/dft.cpp index 6462a9ccec5021..cce66cecc21c45 100644 --- a/src/frontends/onnx/frontend/src/op/dft.cpp +++ b/src/frontends/onnx/frontend/src/op/dft.cpp @@ -8,12 +8,12 @@ #include "utils/common.hpp" #include "utils/dft.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector dft(const Node& node) { +ov::OutputVector dft(const ov::frontend::onnx::Node& node) { const ov::OutputVector ng_inputs{node.get_ng_inputs()}; const ov::Output data = ng_inputs.at(0); @@ -30,10 +30,7 @@ ov::OutputVector dft(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dft.hpp b/src/frontends/onnx/frontend/src/op/dft.hpp index 2b808488f80d6a..d3c35133e7d9a7 100644 --- a/src/frontends/onnx/frontend/src/op/dft.hpp +++ b/src/frontends/onnx/frontend/src/op/dft.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector dft(const Node& node); +ov::OutputVector dft(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/div.hpp b/src/frontends/onnx/frontend/src/op/div.hpp index 80578c9478b1d5..764995ffbb5bbe 100644 --- a/src/frontends/onnx/frontend/src/op/div.hpp +++ b/src/frontends/onnx/frontend/src/op/div.hpp @@ -4,32 +4,27 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/divide.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector div(const Node& node) { +inline ov::OutputVector div(const ov::frontend::onnx::Node& node) { return common::handle_opset6_binary_op(node); } } // namespace set_1 namespace set_7 { -inline ov::OutputVector div(const Node& node) { +inline ov::OutputVector div(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_7 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dropout.cpp b/src/frontends/onnx/frontend/src/op/dropout.cpp index bfc998a8ba4635..224d00582457fb 100644 --- a/src/frontends/onnx/frontend/src/op/dropout.cpp +++ b/src/frontends/onnx/frontend/src/op/dropout.cpp @@ -13,12 +13,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace { -ov::OutputVector build_dropout(const Node& node, bool training_mode) { +ov::OutputVector build_dropout(const ov::frontend::onnx::Node& node, bool training_mode) { CHECK_VALID_NODE(node, !training_mode, "Training mode is not supported for Dropout op"); const auto input_data = node.get_ng_inputs().at(0); @@ -36,7 +36,7 @@ ov::OutputVector build_dropout(const Node& node, bool training_mode) { } // namespace namespace set_12 { -ov::OutputVector dropout(const Node& node) { +ov::OutputVector dropout(const ov::frontend::onnx::Node& node) { const auto ng_inputs = node.get_ng_inputs(); // seed attribute and ratio input are ignored because traning mode is not // supported anyway @@ -52,7 +52,7 @@ ov::OutputVector dropout(const Node& node) { } // namespace set_12 namespace set_7 { -ov::OutputVector dropout(const Node& node) { +ov::OutputVector dropout(const ov::frontend::onnx::Node& node) { // "is_test" attribute was removed // ratio attribute is ignored because traning mode is not supported const bool training_mode = false; @@ -62,7 +62,7 @@ ov::OutputVector dropout(const Node& node) { } // namespace set_7 namespace set_1 { -ov::OutputVector dropout(const Node& node) { +ov::OutputVector dropout(const ov::frontend::onnx::Node& node) { // legacy consumed_inputs attribute ignored // ratio attribute is ignored because traning mode is not supported const bool training_mode = !node.get_attribute_value("is_test", 0); @@ -70,10 +70,7 @@ ov::OutputVector dropout(const Node& node) { return build_dropout(node, training_mode); } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dropout.hpp b/src/frontends/onnx/frontend/src/op/dropout.hpp index 010123f044fc5f..e0826063c2ae94 100644 --- a/src/frontends/onnx/frontend/src/op/dropout.hpp +++ b/src/frontends/onnx/frontend/src/op/dropout.hpp @@ -4,29 +4,24 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_12 { -ov::OutputVector dropout(const Node& node); +ov::OutputVector dropout(const ov::frontend::onnx::Node& node); } // namespace set_12 namespace set_7 { -ov::OutputVector dropout(const Node& node); +ov::OutputVector dropout(const ov::frontend::onnx::Node& node); } // namespace set_7 namespace set_1 { -ov::OutputVector dropout(const Node& node); +ov::OutputVector dropout(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp index 20e874d1f5d1ac..6c5f5535e0ba71 100644 --- a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp @@ -25,9 +25,9 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace { std::shared_ptr find_min_value(const ov::Output& input) { const auto& zero_node = v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); @@ -79,7 +79,7 @@ std::shared_ptr quantize_linear(ov::Output x, } // namespace namespace op { namespace set_1 { -ov::OutputVector dynamic_quantize_linear(const Node& node) { +ov::OutputVector dynamic_quantize_linear(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); const auto& x = inputs.at(0); @@ -108,6 +108,6 @@ ov::OutputVector dynamic_quantize_linear(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.hpp b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.hpp index 577c43cea4ce0f..2218f74c40a95a 100644 --- a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.hpp +++ b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.hpp @@ -4,19 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector dynamic_quantize_linear(const Node& node); +ov::OutputVector dynamic_quantize_linear(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/einsum.cpp b/src/frontends/onnx/frontend/src/op/einsum.cpp index 204f770bf055a9..499f6518cbbea0 100644 --- a/src/frontends/onnx/frontend/src/op/einsum.cpp +++ b/src/frontends/onnx/frontend/src/op/einsum.cpp @@ -8,22 +8,19 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector einsum(const Node& node) { +ov::OutputVector einsum(const ov::frontend::onnx::Node& node) { const std::string& equation{node.get_attribute_value("equation")}; - return ov::OutputVector{std::make_shared(node.get_ng_inputs(), equation)}; + return {std::make_shared(node.get_ng_inputs(), equation)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/einsum.hpp b/src/frontends/onnx/frontend/src/op/einsum.hpp index d588ca5aca5a1b..22821224537918 100644 --- a/src/frontends/onnx/frontend/src/op/einsum.hpp +++ b/src/frontends/onnx/frontend/src/op/einsum.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector einsum(const Node& node); +ov::OutputVector einsum(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/elu.cpp b/src/frontends/onnx/frontend/src/op/elu.cpp index fc8345df202d67..30676ca63fb094 100644 --- a/src/frontends/onnx/frontend/src/op/elu.cpp +++ b/src/frontends/onnx/frontend/src/op/elu.cpp @@ -8,23 +8,20 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector elu(const Node& node) { +ov::OutputVector elu(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); double alpha = node.get_attribute_value("alpha", 1); - return ov::OutputVector{std::make_shared(data, alpha)}; + return {std::make_shared(data, alpha)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/elu.hpp b/src/frontends/onnx/frontend/src/op/elu.hpp index a645bc5e5280f2..87ef5d46639726 100644 --- a/src/frontends/onnx/frontend/src/op/elu.hpp +++ b/src/frontends/onnx/frontend/src/op/elu.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector elu(const Node& node); +ov::OutputVector elu(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/equal.hpp b/src/frontends/onnx/frontend/src/op/equal.hpp index 5a8a6da6bc2b3e..4615307ddd5cf6 100644 --- a/src/frontends/onnx/frontend/src/op/equal.hpp +++ b/src/frontends/onnx/frontend/src/op/equal.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/equal.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector equal(const Node& node) { +inline ov::OutputVector equal(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/erf.hpp b/src/frontends/onnx/frontend/src/op/erf.hpp index 2a5a75b2516546..2b1252df7b4fe6 100644 --- a/src/frontends/onnx/frontend/src/op/erf.hpp +++ b/src/frontends/onnx/frontend/src/op/erf.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/erf.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector erf(const Node& node) { +inline ov::OutputVector erf(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/exp.hpp b/src/frontends/onnx/frontend/src/op/exp.hpp index c133241934a601..38a69a619c7e4a 100644 --- a/src/frontends/onnx/frontend/src/op/exp.hpp +++ b/src/frontends/onnx/frontend/src/op/exp.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/exp.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector exp(const Node& node) { +inline ov::OutputVector exp(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/expand.cpp b/src/frontends/onnx/frontend/src/op/expand.cpp index f7b7c1bf935e20..1bc132670806f6 100644 --- a/src/frontends/onnx/frontend/src/op/expand.cpp +++ b/src/frontends/onnx/frontend/src/op/expand.cpp @@ -11,12 +11,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector expand(const Node& node) { +ov::OutputVector expand(const ov::frontend::onnx::Node& node) { const ov::Output data{node.get_ng_inputs().at(0)}; const ov::Output shape{node.get_ng_inputs().at(1)}; @@ -32,10 +32,7 @@ ov::OutputVector expand(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/expand.hpp b/src/frontends/onnx/frontend/src/op/expand.hpp index 80cf415bc7dd07..7ffd8478465c14 100644 --- a/src/frontends/onnx/frontend/src/op/expand.hpp +++ b/src/frontends/onnx/frontend/src/op/expand.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 // Expand operator has been available since version 8 of the default ONNX operator set. // Currently, Expand is assigned to version 1 due to temporary reason. { -ov::OutputVector expand(const Node& node); +ov::OutputVector expand(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/eye_like.cpp b/src/frontends/onnx/frontend/src/op/eye_like.cpp index 6b1bd5088eda77..1800613d3dc828 100644 --- a/src/frontends/onnx/frontend/src/op/eye_like.cpp +++ b/src/frontends/onnx/frontend/src/op/eye_like.cpp @@ -13,9 +13,9 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace detail { namespace { @@ -33,7 +33,7 @@ ov::OutputVector get_shape_width_and_height(const ov::Output& shape) { namespace set_1 { -ov::OutputVector eye_like(const Node& node) { +ov::OutputVector eye_like(const ov::frontend::onnx::Node& node) { const auto input = node.get_ng_inputs().at(0); const auto& input_rank = input.get_partial_shape().rank(); @@ -65,6 +65,6 @@ ov::OutputVector eye_like(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/eye_like.hpp b/src/frontends/onnx/frontend/src/op/eye_like.hpp index f9e5d69b34b280..700a57e61ce032 100644 --- a/src/frontends/onnx/frontend/src/op/eye_like.hpp +++ b/src/frontends/onnx/frontend/src/op/eye_like.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector eye_like(const Node& node); +ov::OutputVector eye_like(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/flatten.cpp b/src/frontends/onnx/frontend/src/op/flatten.cpp index 3f32c2f5f894f2..c6f8b822cc865c 100644 --- a/src/frontends/onnx/frontend/src/op/flatten.cpp +++ b/src/frontends/onnx/frontend/src/op/flatten.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector flatten(const Node& node) { +ov::OutputVector flatten(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; auto data = inputs.at(0); auto axis = node.get_attribute_value("axis", 1); @@ -31,9 +31,7 @@ ov::OutputVector flatten(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/flatten.hpp b/src/frontends/onnx/frontend/src/op/flatten.hpp index fb68711ddf79ff..aa3165f12d0798 100644 --- a/src/frontends/onnx/frontend/src/op/flatten.hpp +++ b/src/frontends/onnx/frontend/src/op/flatten.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector flatten(const Node& node); +ov::OutputVector flatten(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/floor.hpp b/src/frontends/onnx/frontend/src/op/floor.hpp index 1688df283691e4..98fcf88af49c6b 100644 --- a/src/frontends/onnx/frontend/src/op/floor.hpp +++ b/src/frontends/onnx/frontend/src/op/floor.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/floor.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector floor(const Node& node) { +inline ov::OutputVector floor(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gather.hpp b/src/frontends/onnx/frontend/src/op/gather.hpp index 302a449fb2472b..5664081a10962c 100644 --- a/src/frontends/onnx/frontend/src/op/gather.hpp +++ b/src/frontends/onnx/frontend/src/op/gather.hpp @@ -4,18 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/gather.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector gather(const Node& node) { +inline ov::OutputVector gather(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; auto data = ng_inputs.at(0); auto indices = ng_inputs.at(1); @@ -28,6 +26,6 @@ inline ov::OutputVector gather(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gather_elements.hpp b/src/frontends/onnx/frontend/src/op/gather_elements.hpp index f2f4536392aefd..c0c187389083f8 100644 --- a/src/frontends/onnx/frontend/src/op/gather_elements.hpp +++ b/src/frontends/onnx/frontend/src/op/gather_elements.hpp @@ -4,16 +4,14 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "openvino/op/gather_elements.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector gather_elements(const Node& node) { +inline ov::OutputVector gather_elements(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; auto data = ng_inputs.at(0); auto indices = ng_inputs.at(1); @@ -23,6 +21,6 @@ inline ov::OutputVector gather_elements(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gather_nd.cpp b/src/frontends/onnx/frontend/src/op/gather_nd.cpp index 2f2c21560a5c50..faeb2539db1e3b 100644 --- a/src/frontends/onnx/frontend/src/op/gather_nd.cpp +++ b/src/frontends/onnx/frontend/src/op/gather_nd.cpp @@ -11,12 +11,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector gather_nd(const Node& node) { +ov::OutputVector gather_nd(const ov::frontend::onnx::Node& node) { const ov::OutputVector ng_inputs{node.get_ng_inputs()}; const auto data = ng_inputs.at(0); const auto indices = ng_inputs.at(1); @@ -26,10 +26,7 @@ ov::OutputVector gather_nd(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gather_nd.hpp b/src/frontends/onnx/frontend/src/op/gather_nd.hpp index 38f6e3fbbe6542..5053780c00a215 100644 --- a/src/frontends/onnx/frontend/src/op/gather_nd.hpp +++ b/src/frontends/onnx/frontend/src/op/gather_nd.hpp @@ -7,22 +7,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector gather_nd(const Node& node); +ov::OutputVector gather_nd(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gelu.cpp b/src/frontends/onnx/frontend/src/op/gelu.cpp index 31e3a2caeee4ad..05bf71f5f4647c 100644 --- a/src/frontends/onnx/frontend/src/op/gelu.cpp +++ b/src/frontends/onnx/frontend/src/op/gelu.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector gelu(const Node& node) { +ov::OutputVector gelu(const ov::frontend::onnx::Node& node) { const auto& inputs = node.get_ng_inputs(); std::string approximate = node.get_attribute_value("approximate", ""); @@ -34,6 +34,6 @@ ov::OutputVector gelu(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gelu.hpp b/src/frontends/onnx/frontend/src/op/gelu.hpp index a202ed43b3d283..242da0fb5b7730 100644 --- a/src/frontends/onnx/frontend/src/op/gelu.hpp +++ b/src/frontends/onnx/frontend/src/op/gelu.hpp @@ -3,20 +3,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector gelu(const Node& node); +ov::OutputVector gelu(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gemm.cpp b/src/frontends/onnx/frontend/src/op/gemm.cpp index 6f344faccad92d..1985d502534e17 100644 --- a/src/frontends/onnx/frontend/src/op/gemm.cpp +++ b/src/frontends/onnx/frontend/src/op/gemm.cpp @@ -13,12 +13,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector gemm(const Node& node) { +ov::OutputVector gemm(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; ov::Output input_a = inputs.at(0); ov::Output input_b = inputs.at(1); @@ -62,7 +62,7 @@ ov::OutputVector gemm(const Node& node) { } // namespace set_1 namespace set_6 { -ov::OutputVector gemm(const Node& node) { +ov::OutputVector gemm(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; ov::Output input_a = inputs.at(0); ov::Output input_b = inputs.at(1); @@ -90,9 +90,7 @@ ov::OutputVector gemm(const Node& node) { } } // namespace set_6 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gemm.hpp b/src/frontends/onnx/frontend/src/op/gemm.hpp index bc25e2cfac3aa5..71b43dea77cca6 100644 --- a/src/frontends/onnx/frontend/src/op/gemm.hpp +++ b/src/frontends/onnx/frontend/src/op/gemm.hpp @@ -4,26 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector gemm(const Node& node); +ov::OutputVector gemm(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_6 { -ov::OutputVector gemm(const Node& node); +ov::OutputVector gemm(const ov::frontend::onnx::Node& node); } // namespace set_6 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/global_average_pool.cpp b/src/frontends/onnx/frontend/src/op/global_average_pool.cpp index 771f8ecbda7e5c..ddf09f3226fc50 100644 --- a/src/frontends/onnx/frontend/src/op/global_average_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/global_average_pool.cpp @@ -13,12 +13,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector global_average_pool(const Node& node) { +ov::OutputVector global_average_pool(const ov::frontend::onnx::Node& node) { // Generate axes for reduce operation which contain all spatial dims indexes. // Examples: // Input shape: [N, C, H, W] @@ -44,10 +44,7 @@ ov::OutputVector global_average_pool(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/global_average_pool.hpp b/src/frontends/onnx/frontend/src/op/global_average_pool.hpp index 80125b2e42c813..798055ff530afd 100644 --- a/src/frontends/onnx/frontend/src/op/global_average_pool.hpp +++ b/src/frontends/onnx/frontend/src/op/global_average_pool.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Convert ONNX GlobalAveragePool operation to an OV node. @@ -19,13 +17,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX /// GlobalAveragePool operation. -ov::OutputVector global_average_pool(const Node& node); +ov::OutputVector global_average_pool(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/global_max_pool.cpp b/src/frontends/onnx/frontend/src/op/global_max_pool.cpp index 8b2ad4b252e31f..277dea1cc2450b 100644 --- a/src/frontends/onnx/frontend/src/op/global_max_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/global_max_pool.cpp @@ -13,12 +13,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector global_max_pool(const Node& node) { +ov::OutputVector global_max_pool(const ov::frontend::onnx::Node& node) { // Generate axes for reduce operation which contain all spatial dims indexes. // Examples: // Input shape: [N, C, H, W] @@ -44,10 +44,7 @@ ov::OutputVector global_max_pool(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/global_max_pool.hpp b/src/frontends/onnx/frontend/src/op/global_max_pool.hpp index 744c10d0dd8ab3..b282fdd2993e71 100644 --- a/src/frontends/onnx/frontend/src/op/global_max_pool.hpp +++ b/src/frontends/onnx/frontend/src/op/global_max_pool.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Convert ONNX GlobalMaxPool operation to an OV node. @@ -19,13 +17,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX /// GlobalMaxPool operation. -ov::OutputVector global_max_pool(const Node& node); +ov::OutputVector global_max_pool(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/greater.hpp b/src/frontends/onnx/frontend/src/op/greater.hpp index 5e8aec2fceb6a8..1ac5db2c6c23d4 100644 --- a/src/frontends/onnx/frontend/src/op/greater.hpp +++ b/src/frontends/onnx/frontend/src/op/greater.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/greater.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector greater(const Node& node) { +inline ov::OutputVector greater(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp b/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp index f21531a4a2e80e..5349e4a473a1d6 100644 --- a/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp +++ b/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector greater_or_equal(const Node& node) { +ov::OutputVector greater_or_equal(const ov::frontend::onnx::Node& node) { const auto A = node.get_ng_inputs().at(0); const auto B = node.get_ng_inputs().at(1); @@ -29,7 +29,7 @@ ov::OutputVector greater_or_equal(const Node& node) { } // namespace set_1 namespace set_16 { -ov::OutputVector greater_or_equal(const Node& node) { +ov::OutputVector greater_or_equal(const ov::frontend::onnx::Node& node) { const auto A = node.get_ng_inputs().at(0); const auto B = node.get_ng_inputs().at(1); @@ -39,6 +39,6 @@ ov::OutputVector greater_or_equal(const Node& node) { } } // namespace set_16 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/greater_or_equal.hpp b/src/frontends/onnx/frontend/src/op/greater_or_equal.hpp index a10a44148d966e..ecdaa2fe6020a4 100644 --- a/src/frontends/onnx/frontend/src/op/greater_or_equal.hpp +++ b/src/frontends/onnx/frontend/src/op/greater_or_equal.hpp @@ -4,24 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector greater_or_equal(const Node& node); +ov::OutputVector greater_or_equal(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_16 { -ov::OutputVector greater_or_equal(const Node& node); +ov::OutputVector greater_or_equal(const ov::frontend::onnx::Node& node); } // namespace set_16 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/grid_sample.cpp b/src/frontends/onnx/frontend/src/op/grid_sample.cpp index 63f2cb0166fd41..a059241881f9b7 100644 --- a/src/frontends/onnx/frontend/src/op/grid_sample.cpp +++ b/src/frontends/onnx/frontend/src/op/grid_sample.cpp @@ -8,12 +8,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector grid_sample(const Node& node) { +ov::OutputVector grid_sample(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const auto grid = node.get_ng_inputs().at(1); @@ -30,6 +30,6 @@ ov::OutputVector grid_sample(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/grid_sample.hpp b/src/frontends/onnx/frontend/src/op/grid_sample.hpp index 875f0d085afb8f..2997f1581c95ec 100644 --- a/src/frontends/onnx/frontend/src/op/grid_sample.hpp +++ b/src/frontends/onnx/frontend/src/op/grid_sample.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector grid_sample(const Node& node); +ov::OutputVector grid_sample(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/group_normalization.cpp b/src/frontends/onnx/frontend/src/op/group_normalization.cpp index c1176dd1ac9cd6..6a43a328dd8415 100644 --- a/src/frontends/onnx/frontend/src/op/group_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/group_normalization.cpp @@ -16,12 +16,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector group_normalization(const Node& node) { +ov::OutputVector group_normalization(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); OPENVINO_ASSERT(inputs.size() == 3); @@ -54,6 +54,6 @@ ov::OutputVector group_normalization(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/group_normalization.hpp b/src/frontends/onnx/frontend/src/op/group_normalization.hpp index f71164f5e50779..a7d13af83293f3 100644 --- a/src/frontends/onnx/frontend/src/op/group_normalization.hpp +++ b/src/frontends/onnx/frontend/src/op/group_normalization.hpp @@ -4,19 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector group_normalization(const Node& node); +ov::OutputVector group_normalization(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gru.cpp b/src/frontends/onnx/frontend/src/op/gru.cpp index c0e9ae251c94ca..d34f71f7293112 100644 --- a/src/frontends/onnx/frontend/src/op/gru.cpp +++ b/src/frontends/onnx/frontend/src/op/gru.cpp @@ -16,9 +16,9 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { namespace { @@ -78,7 +78,7 @@ struct GRUAttributes : public recurrent::OpAttributes { }; } // namespace -ov::OutputVector gru(const Node& node) { +ov::OutputVector gru(const ov::frontend::onnx::Node& node) { constexpr std::size_t gates_count = 3; GRUInputMap input_map{node, gates_count}; GRUAttributes attributes{node}; @@ -104,10 +104,7 @@ ov::OutputVector gru(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/gru.hpp b/src/frontends/onnx/frontend/src/op/gru.hpp index a128b3753a7216..3d79096b2d69d9 100644 --- a/src/frontends/onnx/frontend/src/op/gru.hpp +++ b/src/frontends/onnx/frontend/src/op/gru.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector gru(const Node& node); +ov::OutputVector gru(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hammingwindow.cpp b/src/frontends/onnx/frontend/src/op/hammingwindow.cpp index 91ed09a1efa94a..50fd5b0a2dd90d 100644 --- a/src/frontends/onnx/frontend/src/op/hammingwindow.cpp +++ b/src/frontends/onnx/frontend/src/op/hammingwindow.cpp @@ -18,12 +18,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hammingwindow(const Node& node) { +ov::OutputVector hammingwindow(const ov::frontend::onnx::Node& node) { const auto size = node.get_ng_inputs().at(0); const auto output_datatype = common::get_ov_element_type(node.get_attribute_value("output_datatype", 1)); const bool periodic = node.get_attribute_value("periodic", 1) == 1; @@ -69,6 +69,6 @@ ov::OutputVector hammingwindow(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hammingwindow.hpp b/src/frontends/onnx/frontend/src/op/hammingwindow.hpp index 2d0e46cf9e4015..c6feeaa3ade805 100644 --- a/src/frontends/onnx/frontend/src/op/hammingwindow.hpp +++ b/src/frontends/onnx/frontend/src/op/hammingwindow.hpp @@ -3,20 +3,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hammingwindow(const Node& node); +ov::OutputVector hammingwindow(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hannwindow.cpp b/src/frontends/onnx/frontend/src/op/hannwindow.cpp index c35e0c6c9791ad..8e981529985b20 100644 --- a/src/frontends/onnx/frontend/src/op/hannwindow.cpp +++ b/src/frontends/onnx/frontend/src/op/hannwindow.cpp @@ -18,12 +18,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hannwindow(const Node& node) { +ov::OutputVector hannwindow(const ov::frontend::onnx::Node& node) { const auto size = node.get_ng_inputs().at(0); const auto output_datatype = common::get_ov_element_type(node.get_attribute_value("output_datatype", 1)); const bool periodic = node.get_attribute_value("periodic", 1) == 1; @@ -65,6 +65,6 @@ ov::OutputVector hannwindow(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hannwindow.hpp b/src/frontends/onnx/frontend/src/op/hannwindow.hpp index b2e6f11967ec6d..120a8af9ef3d37 100644 --- a/src/frontends/onnx/frontend/src/op/hannwindow.hpp +++ b/src/frontends/onnx/frontend/src/op/hannwindow.hpp @@ -3,20 +3,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hannwindow(const Node& node); +ov::OutputVector hannwindow(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp b/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp index d486648d6c389a..0908b424feab52 100644 --- a/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp +++ b/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp @@ -10,12 +10,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hard_sigmoid(const Node& node) { +ov::OutputVector hard_sigmoid(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const auto alpha = @@ -31,10 +31,7 @@ ov::OutputVector hard_sigmoid(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hard_sigmoid.hpp b/src/frontends/onnx/frontend/src/op/hard_sigmoid.hpp index 3cd2a23cc16159..3b6d36c38d8a74 100644 --- a/src/frontends/onnx/frontend/src/op/hard_sigmoid.hpp +++ b/src/frontends/onnx/frontend/src/op/hard_sigmoid.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hard_sigmoid(const Node& node); +ov::OutputVector hard_sigmoid(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hard_swish.hpp b/src/frontends/onnx/frontend/src/op/hard_swish.hpp index d296977b3814e3..435fbf8a818a8e 100644 --- a/src/frontends/onnx/frontend/src/op/hard_swish.hpp +++ b/src/frontends/onnx/frontend/src/op/hard_swish.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/hswish.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector hard_swish(const Node& node) { +inline ov::OutputVector hard_swish(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hardmax.cpp b/src/frontends/onnx/frontend/src/op/hardmax.cpp index 3e10c77394ca0f..2c2de6e94ce7e9 100644 --- a/src/frontends/onnx/frontend/src/op/hardmax.cpp +++ b/src/frontends/onnx/frontend/src/op/hardmax.cpp @@ -19,12 +19,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hardmax(const Node& node) { +ov::OutputVector hardmax(const ov::frontend::onnx::Node& node) { const auto input = node.get_ng_inputs().at(0); const auto& input_shape = input.get_partial_shape(); @@ -41,7 +41,7 @@ ov::OutputVector hardmax(const Node& node) { std::make_shared(coerced_tensor_shape, ov::op::v0::Constant::create(ov::element::i64, {1}, {1}), ov::op::v0::Constant::create(ov::element::i64, {}, {0})); - row_size = ngraph::onnx_import::reshape::interpret_as_scalar(row_size); + row_size = ov::frontend::onnx::reshape::interpret_as_scalar(row_size); const auto indices_axis = 1; const auto topk = std::make_shared(coerced_tensor, @@ -62,7 +62,7 @@ ov::OutputVector hardmax(const Node& node) { } // namespace set_1 namespace set_13 { -ov::OutputVector hardmax(const Node& node) { +ov::OutputVector hardmax(const ov::frontend::onnx::Node& node) { const auto input = node.get_ng_inputs().at(0); const auto& input_shape = input.get_partial_shape(); @@ -74,7 +74,7 @@ ov::OutputVector hardmax(const Node& node) { std::make_shared(input_runtime_shape, ov::op::v0::Constant::create(ov::element::i64, {1}, {axis}), ov::op::v0::Constant::create(ov::element::i64, {}, {0})); - row_size = ngraph::onnx_import::reshape::interpret_as_scalar(row_size); + row_size = ov::frontend::onnx::reshape::interpret_as_scalar(row_size); const auto topk = std::make_shared(input, ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {1}), @@ -94,8 +94,6 @@ ov::OutputVector hardmax(const Node& node) { } // namespace set_13 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/hardmax.hpp b/src/frontends/onnx/frontend/src/op/hardmax.hpp index 1f6404a91ad9ab..a75c38538f421d 100644 --- a/src/frontends/onnx/frontend/src/op/hardmax.hpp +++ b/src/frontends/onnx/frontend/src/op/hardmax.hpp @@ -4,24 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector hardmax(const Node& node); +ov::OutputVector hardmax(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_13 { -ov::OutputVector hardmax(const Node& node); +ov::OutputVector hardmax(const ov::frontend::onnx::Node& node); } // namespace set_13 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/identity.hpp b/src/frontends/onnx/frontend/src/op/identity.hpp index d9e60db248386c..254e4480a29e5d 100644 --- a/src/frontends/onnx/frontend/src/op/identity.hpp +++ b/src/frontends/onnx/frontend/src/op/identity.hpp @@ -4,17 +4,15 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "utils/common.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector identity(const Node& node) { +inline ov::OutputVector identity(const ov::frontend::onnx::Node& node) { ov::OutputVector outputs = node.get_ng_inputs(); for (auto& out : outputs) { common::mark_as_optimized_out(out); @@ -22,10 +20,7 @@ inline ov::OutputVector identity(const Node& node) { return outputs; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/if.cpp b/src/frontends/onnx/frontend/src/op/if.cpp index 9db991311a6ac4..4aecf72995184c 100644 --- a/src/frontends/onnx/frontend/src/op/if.cpp +++ b/src/frontends/onnx/frontend/src/op/if.cpp @@ -5,17 +5,18 @@ #include "op/if.hpp" #include "core/graph.hpp" +#include "openvino/core/model.hpp" #include "openvino/frontend/exception.hpp" #include "openvino/op/if.hpp" using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector if_op(const Node& node) { +ov::OutputVector if_op(const ov::frontend::onnx::Node& node) { const auto& ng_inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(ng_inputs.size() == 1, "If operator takes only one input"); @@ -68,6 +69,6 @@ ov::OutputVector if_op(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/if.hpp b/src/frontends/onnx/frontend/src/op/if.hpp index 2f0c6542385301..97ed4b0e5129a3 100644 --- a/src/frontends/onnx/frontend/src/op/if.hpp +++ b/src/frontends/onnx/frontend/src/op/if.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Convert ONNX If operation to an OV node. @@ -19,10 +17,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX If /// operation. -ov::OutputVector if_op(const Node& node); +ov::OutputVector if_op(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/image_scaler.cpp b/src/frontends/onnx/frontend/src/op/image_scaler.cpp index b0a595ed607491..8e4b70d2cf0c02 100644 --- a/src/frontends/onnx/frontend/src/op/image_scaler.cpp +++ b/src/frontends/onnx/frontend/src/op/image_scaler.cpp @@ -11,12 +11,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector image_scaler(const Node& node) { +ov::OutputVector image_scaler(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 1, "ImageScaler 1 input tensor. Got: ", inputs.size()); @@ -44,6 +44,6 @@ ov::OutputVector image_scaler(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/image_scaler.hpp b/src/frontends/onnx/frontend/src/op/image_scaler.hpp index 9b00e165de5dc4..21fb1970fe2d07 100644 --- a/src/frontends/onnx/frontend/src/op/image_scaler.hpp +++ b/src/frontends/onnx/frontend/src/op/image_scaler.hpp @@ -4,18 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector image_scaler(const Node& node); +ov::OutputVector image_scaler(const ov::frontend::onnx::Node& node); } } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/instance_norm.cpp b/src/frontends/onnx/frontend/src/op/instance_norm.cpp index 2cb00787c6e377..b9f0849dea44aa 100644 --- a/src/frontends/onnx/frontend/src/op/instance_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/instance_norm.cpp @@ -14,12 +14,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector instance_norm(const Node& node) { +ov::OutputVector instance_norm(const ov::frontend::onnx::Node& node) { ov::Output data(node.get_ng_inputs().at(0)); ov::Output scale(node.get_ng_inputs().at(1)); ov::Output bias(node.get_ng_inputs().at(2)); @@ -78,10 +78,7 @@ ov::OutputVector instance_norm(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/instance_norm.hpp b/src/frontends/onnx/frontend/src/op/instance_norm.hpp index 7dcbf380f5b809..d8c4063c15abba 100644 --- a/src/frontends/onnx/frontend/src/op/instance_norm.hpp +++ b/src/frontends/onnx/frontend/src/op/instance_norm.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Creates OV node representing ONNX InstanceNormalization @@ -24,12 +22,9 @@ namespace set_1 { /// /// \return Vector of nodes containting resulting OV nodes. /// -ov::OutputVector instance_norm(const Node& node); +ov::OutputVector instance_norm(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/is_finite.cpp b/src/frontends/onnx/frontend/src/op/is_finite.cpp index aa33d3cdaf1e94..cc9fbba820b0b6 100644 --- a/src/frontends/onnx/frontend/src/op/is_finite.cpp +++ b/src/frontends/onnx/frontend/src/op/is_finite.cpp @@ -8,19 +8,19 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector is_finite(const Node& node) { +ov::OutputVector is_finite(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); return {std::make_shared(data)}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/is_finite.hpp b/src/frontends/onnx/frontend/src/op/is_finite.hpp index c3e30fa5451813..8988aa5d8002a9 100644 --- a/src/frontends/onnx/frontend/src/op/is_finite.hpp +++ b/src/frontends/onnx/frontend/src/op/is_finite.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector is_finite(const Node& node); +ov::OutputVector is_finite(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/is_inf.cpp b/src/frontends/onnx/frontend/src/op/is_inf.cpp index f206d74fe90def..3b7b8ce05b96ca 100644 --- a/src/frontends/onnx/frontend/src/op/is_inf.cpp +++ b/src/frontends/onnx/frontend/src/op/is_inf.cpp @@ -8,12 +8,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector is_inf(const Node& node) { +ov::OutputVector is_inf(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); ov::opset10::IsInf::Attributes attributes{}; @@ -24,6 +24,6 @@ ov::OutputVector is_inf(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/is_inf.hpp b/src/frontends/onnx/frontend/src/op/is_inf.hpp index a57cdc47a4b9e1..c168141b8b9337 100644 --- a/src/frontends/onnx/frontend/src/op/is_inf.hpp +++ b/src/frontends/onnx/frontend/src/op/is_inf.hpp @@ -4,19 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector is_inf(const Node& node); +ov::OutputVector is_inf(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/is_nan.cpp b/src/frontends/onnx/frontend/src/op/is_nan.cpp index 523a0fb4ebecdd..f29620ee661ada 100644 --- a/src/frontends/onnx/frontend/src/op/is_nan.cpp +++ b/src/frontends/onnx/frontend/src/op/is_nan.cpp @@ -8,19 +8,19 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector is_nan(const Node& node) { +ov::OutputVector is_nan(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); return {std::make_shared(data)}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/is_nan.hpp b/src/frontends/onnx/frontend/src/op/is_nan.hpp index 6a4511bb16e629..065253f66a473e 100644 --- a/src/frontends/onnx/frontend/src/op/is_nan.hpp +++ b/src/frontends/onnx/frontend/src/op/is_nan.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector is_nan(const Node& node); +ov::OutputVector is_nan(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/layer_normalization.cpp index 234578b562acf5..27746a2f7b4655 100644 --- a/src/frontends/onnx/frontend/src/op/layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/layer_normalization.cpp @@ -27,15 +27,17 @@ using namespace ov::op; using namespace ov::op::v0; using namespace ov::op::v1; using namespace ov::op::v8; +using ::ONNX_NAMESPACE::TensorProto_DataType; using ov::Shape; OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector layer_normalization(const Node& node) { +ov::OutputVector layer_normalization(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); const auto num_inputs = inputs.size(); CHECK_VALID_NODE(node, @@ -50,7 +52,7 @@ ov::OutputVector layer_normalization(const Node& node) { double epsilon = node.get_attribute_value("epsilon", 1e-5); int64_t stash_type_i = node.get_attribute_value("stash_type", - static_cast(ONNX_NAMESPACE::TensorProto_DataType_FLOAT)); + static_cast(TensorProto_DataType::TensorProto_DataType_FLOAT)); element::Type stash_type = common::get_ov_element_type(stash_type_i); // following calculations are kept as close to the onnx\defs.cc description as possible @@ -67,7 +69,7 @@ ov::OutputVector layer_normalization(const Node& node) { auto SuffixShape = std::make_shared(One1D, NumReducedAxes); auto ReducedShape = std::make_shared(ov::OutputVector{PrefixShape, SuffixShape}, 0); - auto X2D = util::flatten(X, static_cast(axis)); + auto X2D = ov::op::util::flatten(X, static_cast(axis)); auto XU = std::make_shared(X2D, stash_type); auto Mean2D = std::make_shared(XU, One1D, true); @@ -82,10 +84,10 @@ ov::OutputVector layer_normalization(const Node& node) { auto Normalized = std::make_shared(Deviation, StdDev); auto NormalizedT = std::make_shared(Normalized, X); - auto Scale2D = util::flatten(Scale, 0); + auto Scale2D = ov::op::util::flatten(Scale, 0); auto Scaled = std::make_shared(NormalizedT, Scale2D); ov::Output Biased = - (num_inputs == 3 ? std::make_shared(Scaled, util::flatten(inputs.at(2), 0))->output(0) + (num_inputs == 3 ? std::make_shared(Scaled, ov::op::util::flatten(inputs.at(2), 0))->output(0) : Scaled->output(0)); auto Y = std::make_shared(Biased, XShape, false); @@ -98,6 +100,7 @@ ov::OutputVector layer_normalization(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/onnx/frontend/src/op/layer_normalization.hpp b/src/frontends/onnx/frontend/src/op/layer_normalization.hpp index edb1ee12201357..b0b79213be4cd7 100644 --- a/src/frontends/onnx/frontend/src/op/layer_normalization.hpp +++ b/src/frontends/onnx/frontend/src/op/layer_normalization.hpp @@ -8,13 +8,15 @@ OPENVINO_SUPPRESS_DEPRECATED_START #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector layer_normalization(const Node& node); +ov::OutputVector layer_normalization(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/onnx/frontend/src/op/leaky_relu.cpp b/src/frontends/onnx/frontend/src/op/leaky_relu.cpp index 1043082ab72427..2d0d8bfdd44e9a 100644 --- a/src/frontends/onnx/frontend/src/op/leaky_relu.cpp +++ b/src/frontends/onnx/frontend/src/op/leaky_relu.cpp @@ -11,12 +11,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector leaky_relu(const Node& node) { +ov::OutputVector leaky_relu(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); double alpha = node.get_attribute_value("alpha", 0.01); @@ -25,10 +25,7 @@ ov::OutputVector leaky_relu(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/leaky_relu.hpp b/src/frontends/onnx/frontend/src/op/leaky_relu.hpp index a3cabf56c1923a..49c390a78d07ce 100644 --- a/src/frontends/onnx/frontend/src/op/leaky_relu.hpp +++ b/src/frontends/onnx/frontend/src/op/leaky_relu.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector leaky_relu(const Node& node); +ov::OutputVector leaky_relu(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/less.hpp b/src/frontends/onnx/frontend/src/op/less.hpp index 275c6c41dd9961..9fb45922767c47 100644 --- a/src/frontends/onnx/frontend/src/op/less.hpp +++ b/src/frontends/onnx/frontend/src/op/less.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/less.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector less(const Node& node) { +inline ov::OutputVector less(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/less_or_equal.cpp b/src/frontends/onnx/frontend/src/op/less_or_equal.cpp index cf4bd6ae5ebbf6..f888ffdc0b635d 100644 --- a/src/frontends/onnx/frontend/src/op/less_or_equal.cpp +++ b/src/frontends/onnx/frontend/src/op/less_or_equal.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector less_or_equal(const Node& node) { +ov::OutputVector less_or_equal(const ov::frontend::onnx::Node& node) { const auto& input = node.get_ng_inputs(); const auto a = input.at(0); const auto b = input.at(1); @@ -26,7 +26,7 @@ ov::OutputVector less_or_equal(const Node& node) { } // namespace set_1 namespace set_16 { -ov::OutputVector less_or_equal(const Node& node) { +ov::OutputVector less_or_equal(const ov::frontend::onnx::Node& node) { const auto& input = node.get_ng_inputs(); const auto a = input.at(0); const auto b = input.at(1); @@ -34,6 +34,6 @@ ov::OutputVector less_or_equal(const Node& node) { } } // namespace set_16 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/less_or_equal.hpp b/src/frontends/onnx/frontend/src/op/less_or_equal.hpp index 2060bd5f16e79b..bae2e37014ec73 100644 --- a/src/frontends/onnx/frontend/src/op/less_or_equal.hpp +++ b/src/frontends/onnx/frontend/src/op/less_or_equal.hpp @@ -4,26 +4,24 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector less_or_equal(const Node& node); +ov::OutputVector less_or_equal(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_16 { -ov::OutputVector less_or_equal(const Node& node); +ov::OutputVector less_or_equal(const ov::frontend::onnx::Node& node); } // namespace set_16 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/log.cpp b/src/frontends/onnx/frontend/src/op/log.cpp index 22cf9d809399c3..946daec483dc19 100644 --- a/src/frontends/onnx/frontend/src/op/log.cpp +++ b/src/frontends/onnx/frontend/src/op/log.cpp @@ -8,20 +8,17 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector log(const Node& node) { +ov::OutputVector log(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/log.hpp b/src/frontends/onnx/frontend/src/op/log.hpp index 1bd9edd731b807..02b8332cd7c649 100644 --- a/src/frontends/onnx/frontend/src/op/log.hpp +++ b/src/frontends/onnx/frontend/src/op/log.hpp @@ -4,20 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector log(const Node& node); +ov::OutputVector log(const ov::frontend::onnx::Node& node); } } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/log_softmax.cpp b/src/frontends/onnx/frontend/src/op/log_softmax.cpp index 37063283a1f796..207a4747b2c2d4 100644 --- a/src/frontends/onnx/frontend/src/op/log_softmax.cpp +++ b/src/frontends/onnx/frontend/src/op/log_softmax.cpp @@ -16,9 +16,9 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace { std::shared_ptr onnx_logsoftmax(const ov::Output data, const int64_t axis) { const auto coerced_data = ov::op::util::flatten(data, static_cast(axis)); @@ -27,7 +27,7 @@ std::shared_ptr onnx_logsoftmax(const ov::Output data, const return std::make_shared(result, data_shape, false); } -ov::OutputVector log_softmax(const Node& node, const int64_t DEFAULT_AXIS) { +ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node, const int64_t DEFAULT_AXIS) { ov::OutputVector inputs{node.get_ng_inputs()}; const auto data = inputs.at(0); const auto data_rank = data.get_partial_shape().rank(); @@ -62,21 +62,18 @@ ov::OutputVector log_softmax(const Node& node, const int64_t DEFAULT_AXIS) { namespace op { namespace set_1 { -ov::OutputVector log_softmax(const Node& node) { - return ngraph::onnx_import::log_softmax(node, 1); +ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node) { + return ov::frontend::onnx::log_softmax(node, 1); } } // namespace set_1 namespace set_13 { -ov::OutputVector log_softmax(const Node& node) { +ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node) { const auto axis = node.get_attribute_value("axis", -1); return {std::make_shared(node.get_ng_inputs()[0], axis)}; } } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/log_softmax.hpp b/src/frontends/onnx/frontend/src/op/log_softmax.hpp index bbd65a9b579099..2a9d799d949bb8 100644 --- a/src/frontends/onnx/frontend/src/op/log_softmax.hpp +++ b/src/frontends/onnx/frontend/src/op/log_softmax.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector log_softmax(const Node& node); +ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_13 { -ov::OutputVector log_softmax(const Node& node); +ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node); } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/loop.cpp b/src/frontends/onnx/frontend/src/op/loop.cpp index cc399a53d46029..98a6801a7337ed 100644 --- a/src/frontends/onnx/frontend/src/op/loop.cpp +++ b/src/frontends/onnx/frontend/src/op/loop.cpp @@ -16,9 +16,9 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { namespace { @@ -39,7 +39,7 @@ bool is_termination_condition_always_true(const ov::Node* cond_in, const ov::Nod } } // namespace -ov::OutputVector loop(const Node& node) { +ov::OutputVector loop(const ov::frontend::onnx::Node& node) { const auto& ng_inputs = node.get_ng_inputs(); const ov::OutputVector loop_carried_dependencies{std::next(ng_inputs.begin(), 2), ng_inputs.end()}; @@ -175,6 +175,6 @@ ov::OutputVector loop(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/loop.hpp b/src/frontends/onnx/frontend/src/op/loop.hpp index c08ee77c3e1ffa..94702c2412e640 100644 --- a/src/frontends/onnx/frontend/src/op/loop.hpp +++ b/src/frontends/onnx/frontend/src/op/loop.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Creates OV node representing ONNX loop operator. @@ -22,12 +20,9 @@ namespace set_1 { /// /// \return Vector of nodes containting resulting OV nodes. /// -ov::OutputVector loop(const Node& node); +ov::OutputVector loop(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lp_norm.cpp b/src/frontends/onnx/frontend/src/op/lp_norm.cpp index c0f90158378684..de2e80c6021241 100644 --- a/src/frontends/onnx/frontend/src/op/lp_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/lp_norm.cpp @@ -12,12 +12,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector lp_norm(const Node& node) { +ov::OutputVector lp_norm(const ov::frontend::onnx::Node& node) { const ov::Output data{node.get_ng_inputs().at(0)}; const auto data_shape = data.get_partial_shape(); const auto data_rank = data_shape.rank(); @@ -41,10 +41,7 @@ ov::OutputVector lp_norm(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lp_norm.hpp b/src/frontends/onnx/frontend/src/op/lp_norm.hpp index 479f171958ea86..9cd7fdf86a7432 100644 --- a/src/frontends/onnx/frontend/src/op/lp_norm.hpp +++ b/src/frontends/onnx/frontend/src/op/lp_norm.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Creates OV node representing ONNX LpNormalization operator. @@ -25,12 +23,9 @@ namespace set_1 { /// /// \return Vector of nodes containting resulting OV nodes. /// -ov::OutputVector lp_norm(const Node& node); +ov::OutputVector lp_norm(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lp_pool.cpp b/src/frontends/onnx/frontend/src/op/lp_pool.cpp index 3b8245c81b1c6e..452909a97a1985 100644 --- a/src/frontends/onnx/frontend/src/op/lp_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/lp_pool.cpp @@ -16,12 +16,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector global_lp_pool(const Node& node) { +ov::OutputVector global_lp_pool(const ov::frontend::onnx::Node& node) { const ov::Output data{node.get_ng_inputs().at(0)}; const std::size_t channel_axis{1}; @@ -58,10 +58,7 @@ ov::OutputVector global_lp_pool(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lp_pool.hpp b/src/frontends/onnx/frontend/src/op/lp_pool.hpp index feab084a23f556..f56012c21f3c8e 100644 --- a/src/frontends/onnx/frontend/src/op/lp_pool.hpp +++ b/src/frontends/onnx/frontend/src/op/lp_pool.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Creates OV node representing ONNX GlobalLpPool operator. @@ -30,12 +28,9 @@ namespace set_1 { /// /// \return Vector of nodes containting resulting OV nodes. /// -ov::OutputVector global_lp_pool(const Node& node); +ov::OutputVector global_lp_pool(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lrn.cpp b/src/frontends/onnx/frontend/src/op/lrn.cpp index 08e7e5c64c067d..c8141e0690bf3a 100644 --- a/src/frontends/onnx/frontend/src/op/lrn.cpp +++ b/src/frontends/onnx/frontend/src/op/lrn.cpp @@ -8,12 +8,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector lrn(const Node& node) { +ov::OutputVector lrn(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); double alpha = node.get_attribute_value("alpha", 1e-4); double beta = node.get_attribute_value("beta", 0.75); @@ -24,10 +24,7 @@ ov::OutputVector lrn(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lrn.hpp b/src/frontends/onnx/frontend/src/op/lrn.hpp index a7f1ca0e4eee13..ce2e048973fe11 100644 --- a/src/frontends/onnx/frontend/src/op/lrn.hpp +++ b/src/frontends/onnx/frontend/src/op/lrn.hpp @@ -4,21 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector lrn(const Node& node); +ov::OutputVector lrn(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lstm.cpp b/src/frontends/onnx/frontend/src/op/lstm.cpp index 5ab1f510ed9ef1..0070d783cd69a9 100644 --- a/src/frontends/onnx/frontend/src/op/lstm.cpp +++ b/src/frontends/onnx/frontend/src/op/lstm.cpp @@ -21,9 +21,9 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INPUT NODES PARSING ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -190,9 +190,8 @@ struct LSTMAttributes { m_activation_beta{node.get_attribute_value>("activation_beta", std::vector{})}, m_input_forget{static_cast(node.get_attribute_value("input_forget", 0))} { m_clip_threshold = std::abs(m_clip_threshold); - OPENVINO_SUPPRESS_DEPRECATED_START + std::string direction = ov::util::to_lower(node.get_attribute_value("direction", "forward")); - OPENVINO_SUPPRESS_DEPRECATED_END m_direction = ov::as_enum(direction); } @@ -209,7 +208,7 @@ struct LSTMAttributes { } // anonymous namespace namespace set_1 { -ov::OutputVector lstm(const Node& node) { +ov::OutputVector lstm(const ov::frontend::onnx::Node& node) { LSTMNgInputMap input_map{node}; LSTMAttributes attributes{node}; std::shared_ptr lstm_sequence; @@ -257,10 +256,7 @@ ov::OutputVector lstm(const Node& node) { ov::op::util::reorder_axes(Y_c, {1, 0, 2})}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/lstm.hpp b/src/frontends/onnx/frontend/src/op/lstm.hpp index 53498fbde0b69c..c7a94162744582 100644 --- a/src/frontends/onnx/frontend/src/op/lstm.hpp +++ b/src/frontends/onnx/frontend/src/op/lstm.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector lstm(const Node& node); +ov::OutputVector lstm(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/matmul.hpp b/src/frontends/onnx/frontend/src/op/matmul.hpp index 059a4c9ba42586..ee38f0d41ebf1c 100644 --- a/src/frontends/onnx/frontend/src/op/matmul.hpp +++ b/src/frontends/onnx/frontend/src/op/matmul.hpp @@ -4,14 +4,12 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/matmul.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace detail { inline ov::OutputVector matmul(const ov::Output& a, const ov::Output& b) { @@ -19,11 +17,11 @@ inline ov::OutputVector matmul(const ov::Output& a, const ov::Output(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/matmul_integer.cpp b/src/frontends/onnx/frontend/src/op/matmul_integer.cpp index 8cc090509da18c..3d0b05a68c9703 100644 --- a/src/frontends/onnx/frontend/src/op/matmul_integer.cpp +++ b/src/frontends/onnx/frontend/src/op/matmul_integer.cpp @@ -12,12 +12,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector matmul_integer(const Node& node) { +ov::OutputVector matmul_integer(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); const auto& A = inputs.at(0); @@ -51,6 +51,6 @@ ov::OutputVector matmul_integer(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/matmul_integer.hpp b/src/frontends/onnx/frontend/src/op/matmul_integer.hpp index d386e97c736cb6..855b2d4f9a78ff 100644 --- a/src/frontends/onnx/frontend/src/op/matmul_integer.hpp +++ b/src/frontends/onnx/frontend/src/op/matmul_integer.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX MatMulInteger operation. @@ -19,9 +17,9 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX quantizied /// matrix multiplication integer operation. -ov::OutputVector matmul_integer(const Node& node); +ov::OutputVector matmul_integer(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/max.hpp b/src/frontends/onnx/frontend/src/op/max.hpp index 11cb9476caafd8..421bd52e530945 100644 --- a/src/frontends/onnx/frontend/src/op/max.hpp +++ b/src/frontends/onnx/frontend/src/op/max.hpp @@ -4,33 +4,28 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/maximum.hpp" #include "utils/variadic.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector max(const Node& node) { +inline ov::OutputVector max(const ov::frontend::onnx::Node& node) { return variadic::make_ng_variadic_op(node, ov::op::AutoBroadcastType::NONE); } } // namespace set_1 namespace set_8 { -inline ov::OutputVector max(const Node& node) { +inline ov::OutputVector max(const ov::frontend::onnx::Node& node) { return variadic::make_ng_variadic_op(node); } } // namespace set_8 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/max_pool.cpp b/src/frontends/onnx/frontend/src/op/max_pool.cpp index bf997d3cbfcb24..78371705456b2d 100644 --- a/src/frontends/onnx/frontend/src/op/max_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/max_pool.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector max_pool(const Node& node) { +ov::OutputVector max_pool(const ov::frontend::onnx::Node& node) { if (node.get_outputs_size() > 1) { OPENVINO_WARN << "MaxPool: Indices output is not supported and was ignored"; } @@ -27,14 +27,11 @@ ov::OutputVector max_pool(const Node& node) { } // namespace set_1 namespace set_8 { -ov::OutputVector max_pool(const Node& node) { +ov::OutputVector max_pool(const ov::frontend::onnx::Node& node) { return pooling::PoolingFactory(node).make_max_pool_with_indices(); } } // namespace set_8 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/max_pool.hpp b/src/frontends/onnx/frontend/src/op/max_pool.hpp index 6036e0d750ff29..a9e305941e8f27 100644 --- a/src/frontends/onnx/frontend/src/op/max_pool.hpp +++ b/src/frontends/onnx/frontend/src/op/max_pool.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// @@ -21,7 +19,7 @@ namespace set_1 { /// \return The vector containing OV nodes producing output of ONNX MaxPool /// operation. /// -ov::OutputVector max_pool(const Node& node); +ov::OutputVector max_pool(const ov::frontend::onnx::Node& node); } // namespace set_1 @@ -34,13 +32,10 @@ namespace set_8 { /// \return The vector containing OV nodes producing output of ONNX MaxPool /// operation. /// -ov::OutputVector max_pool(const Node& node); +ov::OutputVector max_pool(const ov::frontend::onnx::Node& node); } // namespace set_8 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp b/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp index b63c4c3519f059..925d0e2619cdf7 100644 --- a/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector max_roi_pool(const Node& node) { +ov::OutputVector max_roi_pool(const ov::frontend::onnx::Node& node) { const auto& inputs = node.get_ng_inputs(); const auto X = inputs.at(0); const auto rois = inputs.at(1); @@ -30,6 +30,6 @@ ov::OutputVector max_roi_pool(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/max_roi_pool.hpp b/src/frontends/onnx/frontend/src/op/max_roi_pool.hpp index 8dee07b34c8c4c..62bc77f0282ebc 100644 --- a/src/frontends/onnx/frontend/src/op/max_roi_pool.hpp +++ b/src/frontends/onnx/frontend/src/op/max_roi_pool.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector max_roi_pool(const Node& node); +ov::OutputVector max_roi_pool(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/mean.cpp b/src/frontends/onnx/frontend/src/op/mean.cpp index ce2390c056badc..46590daf7d1925 100644 --- a/src/frontends/onnx/frontend/src/op/mean.cpp +++ b/src/frontends/onnx/frontend/src/op/mean.cpp @@ -11,12 +11,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector mean(const Node& node) { +ov::OutputVector mean(const ov::frontend::onnx::Node& node) { auto sum = variadic::make_ng_variadic_op(node).front(); auto count = v0::Constant::create(sum.get_element_type(), ov::Shape{}, {node.get_ng_inputs().size()}); @@ -24,10 +24,7 @@ ov::OutputVector mean(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/mean.hpp b/src/frontends/onnx/frontend/src/op/mean.hpp index 2f01266af01a30..792ad97b335356 100644 --- a/src/frontends/onnx/frontend/src/op/mean.hpp +++ b/src/frontends/onnx/frontend/src/op/mean.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector mean(const Node& node); +ov::OutputVector mean(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp index f610097ea3e80a..1aae54a0bd1396 100644 --- a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector mean_variance_normalization(const Node& node) { +ov::OutputVector mean_variance_normalization(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); bool across_channels = node.get_attribute_value("across_channels", 0); bool normalize_variance = node.get_attribute_value("normalize_variance", 1); @@ -26,7 +26,7 @@ ov::OutputVector mean_variance_normalization(const Node& node) { } // namespace set_1 namespace set_9 { -ov::OutputVector mean_variance_normalization(const Node& node) { +ov::OutputVector mean_variance_normalization(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); auto axes = node.get_attribute_value>("axes", {0, 2, 3}); const std::vector normalized_axes = @@ -36,10 +36,7 @@ ov::OutputVector mean_variance_normalization(const Node& node) { } } // namespace set_9 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.hpp b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.hpp index 4340362ff3ec23..4544600b4c0611 100644 --- a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.hpp +++ b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector mean_variance_normalization(const Node& node); +ov::OutputVector mean_variance_normalization(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_9 { -ov::OutputVector mean_variance_normalization(const Node& node); +ov::OutputVector mean_variance_normalization(const ov::frontend::onnx::Node& node); } // namespace set_9 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/min.hpp b/src/frontends/onnx/frontend/src/op/min.hpp index 9f89374aabf92f..66c6c629cea9a9 100644 --- a/src/frontends/onnx/frontend/src/op/min.hpp +++ b/src/frontends/onnx/frontend/src/op/min.hpp @@ -4,32 +4,27 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/minimum.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector min(const Node& node) { +inline ov::OutputVector min(const ov::frontend::onnx::Node& node) { return variadic::make_ng_variadic_op(node, ov::op::AutoBroadcastType::NONE); } } // namespace set_1 namespace set_8 { -inline ov::OutputVector min(const Node& node) { +inline ov::OutputVector min(const ov::frontend::onnx::Node& node) { return variadic::make_ng_variadic_op(node); } } // namespace set_8 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/mod.cpp b/src/frontends/onnx/frontend/src/op/mod.cpp index 53239b372045ce..3d10b0916c1574 100644 --- a/src/frontends/onnx/frontend/src/op/mod.cpp +++ b/src/frontends/onnx/frontend/src/op/mod.cpp @@ -11,12 +11,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector mod(const Node& node) { +ov::OutputVector mod(const ov::frontend::onnx::Node& node) { ov::Output dividend{node.get_ng_inputs().at(0)}; ov::Output divisor{node.get_ng_inputs().at(1)}; @@ -36,10 +36,7 @@ ov::OutputVector mod(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/mod.hpp b/src/frontends/onnx/frontend/src/op/mod.hpp index 1756664689f151..472bc3693fde78 100644 --- a/src/frontends/onnx/frontend/src/op/mod.hpp +++ b/src/frontends/onnx/frontend/src/op/mod.hpp @@ -4,21 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector mod(const Node& node); +ov::OutputVector mod(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/mul.hpp b/src/frontends/onnx/frontend/src/op/mul.hpp index abb39a7d7b1bf0..01725f752980e2 100644 --- a/src/frontends/onnx/frontend/src/op/mul.hpp +++ b/src/frontends/onnx/frontend/src/op/mul.hpp @@ -4,32 +4,27 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/multiply.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector mul(const Node& node) { +inline ov::OutputVector mul(const ov::frontend::onnx::Node& node) { return common::handle_opset6_binary_op(node); } } // namespace set_1 namespace set_7 { -inline ov::OutputVector mul(const Node& node) { +inline ov::OutputVector mul(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_7 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/neg.hpp b/src/frontends/onnx/frontend/src/op/neg.hpp index 3b30e1b0ca75e4..81a42e5af5f11e 100644 --- a/src/frontends/onnx/frontend/src/op/neg.hpp +++ b/src/frontends/onnx/frontend/src/op/neg.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/negative.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector neg(const Node& node) { +inline ov::OutputVector neg(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/nms_rotated.hpp b/src/frontends/onnx/frontend/src/op/nms_rotated.hpp index dc61560b61aaa2..c2489eff0c1da2 100644 --- a/src/frontends/onnx/frontend/src/op/nms_rotated.hpp +++ b/src/frontends/onnx/frontend/src/op/nms_rotated.hpp @@ -6,18 +6,16 @@ #include -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/nms_rotated.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector nms_rotated(const Node& node) { +inline ov::OutputVector nms_rotated(const ov::frontend::onnx::Node& node) { auto iou_threshold = node.get_attribute_value("iou_threshold"); auto score_threshold = node.get_attribute_value("score_threshold"); auto max_output_boxes_per_class = @@ -36,6 +34,6 @@ inline ov::OutputVector nms_rotated(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp b/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp index 840cb4be1ff12b..0e7f0f94a9afb5 100644 --- a/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp +++ b/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp @@ -12,12 +12,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector non_max_suppression(const Node& node) { +ov::OutputVector non_max_suppression(const ov::frontend::onnx::Node& node) { using ov::op::util::is_null; // TODO: this op will not be tested until at least // a reference implementation is added @@ -28,21 +28,21 @@ ov::OutputVector non_max_suppression(const Node& node) { ov::Output max_output_boxes_per_class; if (ng_inputs.size() > 2 && !is_null(ng_inputs.at(2))) { - max_output_boxes_per_class = ngraph::onnx_import::reshape::interpret_as_scalar(ng_inputs.at(2)); + max_output_boxes_per_class = ov::frontend::onnx::reshape::interpret_as_scalar(ng_inputs.at(2)); } else { max_output_boxes_per_class = v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); } ov::Output iou_threshold; if (ng_inputs.size() > 3 && !is_null(ng_inputs.at(3))) { - iou_threshold = ngraph::onnx_import::reshape::interpret_as_scalar(ng_inputs.at(3)); + iou_threshold = ov::frontend::onnx::reshape::interpret_as_scalar(ng_inputs.at(3)); } else { iou_threshold = v0::Constant::create(ov::element::f32, ov::Shape{}, {.0f}); } ov::Output score_threshold; if (ng_inputs.size() > 4 && !is_null(ng_inputs.at(4))) { - score_threshold = ngraph::onnx_import::reshape::interpret_as_scalar(ng_inputs.at(4)); + score_threshold = ov::frontend::onnx::reshape::interpret_as_scalar(ng_inputs.at(4)); } else { score_threshold = v0::Constant::create(ov::element::f32, ov::Shape{}, {-std::numeric_limits::max()}); } @@ -66,10 +66,7 @@ ov::OutputVector non_max_suppression(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/non_max_suppression.hpp b/src/frontends/onnx/frontend/src/op/non_max_suppression.hpp index 81f67be2f0d621..471d0b262757aa 100644 --- a/src/frontends/onnx/frontend/src/op/non_max_suppression.hpp +++ b/src/frontends/onnx/frontend/src/op/non_max_suppression.hpp @@ -4,21 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector non_max_suppression(const Node& node); +ov::OutputVector non_max_suppression(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/non_zero.cpp b/src/frontends/onnx/frontend/src/op/non_zero.cpp index 3e4bf800852438..486891e091fd4e 100644 --- a/src/frontends/onnx/frontend/src/op/non_zero.cpp +++ b/src/frontends/onnx/frontend/src/op/non_zero.cpp @@ -8,21 +8,18 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector non_zero(const Node& node) { +ov::OutputVector non_zero(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); return {std::make_shared(data, ov::element::i64)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/non_zero.hpp b/src/frontends/onnx/frontend/src/op/non_zero.hpp index 819a9fd5e6163f..dbef0efc410974 100644 --- a/src/frontends/onnx/frontend/src/op/non_zero.hpp +++ b/src/frontends/onnx/frontend/src/op/non_zero.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Convert ONNX NonZero operation to an OV node. @@ -19,13 +17,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX NonZero /// operation. -ov::OutputVector non_zero(const Node& node); +ov::OutputVector non_zero(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/not.hpp b/src/frontends/onnx/frontend/src/op/not.hpp index 0ea0069dc600f6..1241b250935e80 100644 --- a/src/frontends/onnx/frontend/src/op/not.hpp +++ b/src/frontends/onnx/frontend/src/op/not.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/logical_not.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector logical_not(const Node& node) { +inline ov::OutputVector logical_not(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/onehot.cpp b/src/frontends/onnx/frontend/src/op/onehot.cpp index dde66e955ad971..2867761bb3f76b 100644 --- a/src/frontends/onnx/frontend/src/op/onehot.cpp +++ b/src/frontends/onnx/frontend/src/op/onehot.cpp @@ -12,12 +12,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector onehot(const Node& node) { +ov::OutputVector onehot(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; auto indices = std::make_shared(inputs.at(0), ov::element::i64); auto depth = std::make_shared(reshape::interpret_as_scalar(inputs.at(1)), ov::element::i64); @@ -34,9 +34,7 @@ ov::OutputVector onehot(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/onehot.hpp b/src/frontends/onnx/frontend/src/op/onehot.hpp index 24f610ccc2e3a0..8b8a15ad4b5e45 100644 --- a/src/frontends/onnx/frontend/src/op/onehot.hpp +++ b/src/frontends/onnx/frontend/src/op/onehot.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector onehot(const Node& node); +ov::OutputVector onehot(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/or.hpp b/src/frontends/onnx/frontend/src/op/or.hpp index bdcc205d225f78..34608566cb654c 100644 --- a/src/frontends/onnx/frontend/src/op/or.hpp +++ b/src/frontends/onnx/frontend/src/op/or.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/logical_or.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector logical_or(const Node& node) { +inline ov::OutputVector logical_or(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp index b2c1f01342a2c9..48cef700a1f5d8 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp @@ -21,11 +21,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector deformable_conv_2d(const Node& node) { +ov::OutputVector deformable_conv_2d(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); const auto strides = convpool::get_strides(node); const auto dilations = convpool::get_dilations(node); @@ -47,9 +48,7 @@ ov::OutputVector deformable_conv_2d(const Node& node) { deformable_groups)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.hpp index 254328c1b9cf4c..225b8980873cd7 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.hpp @@ -16,21 +16,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector deformable_conv_2d(const Node& node); +ov::OutputVector deformable_conv_2d(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp index e030ce962d43a0..035c7d21ee7445 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp @@ -10,11 +10,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector detection_output(const Node& node) { +ov::OutputVector detection_output(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); auto box_logits = inputs[0]; @@ -67,9 +68,7 @@ ov::OutputVector detection_output(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.hpp index edb95a1d3ea6f9..1dca062281e902 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector detection_output(const Node& node); +ov::OutputVector detection_output(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp index 8a6394b59676c8..5bedbcb8255046 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp @@ -9,11 +9,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_detection_output(const Node& node) { +ov::OutputVector experimental_detectron_detection_output(const ov::frontend::onnx::Node& node) { using DetectionOutput = v6::ExperimentalDetectronDetectionOutput; auto inputs = node.get_ng_inputs(); @@ -37,9 +38,7 @@ ov::OutputVector experimental_detectron_detection_output(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.hpp index 190a54867734fc..07b09d782c0ae3 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.hpp @@ -4,20 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_detection_output(const Node& node); +ov::OutputVector experimental_detectron_detection_output(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp index 3fbdc15c41ad21..48ddd746a83eb8 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp @@ -10,11 +10,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_generate_proposals(const Node& node) { +ov::OutputVector experimental_detectron_generate_proposals(const ov::frontend::onnx::Node& node) { using GenerateProposalsSingleImage = v6::ExperimentalDetectronGenerateProposalsSingleImage; const auto inputs = node.get_ng_inputs(); @@ -39,9 +40,7 @@ ov::OutputVector experimental_detectron_generate_proposals(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.hpp index deaa1a66c3a459..ef1779bf236aad 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.hpp @@ -4,20 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_generate_proposals(const Node& node); +ov::OutputVector experimental_detectron_generate_proposals(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp index ff77748be7d5d8..0139373411d6fa 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp @@ -9,11 +9,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_prior_grid_generator(const Node& node) { +ov::OutputVector experimental_detectron_prior_grid_generator(const ov::frontend::onnx::Node& node) { using PriorGridGenerator = v6::ExperimentalDetectronPriorGridGenerator; auto inputs = node.get_ng_inputs(); @@ -31,9 +32,7 @@ ov::OutputVector experimental_detectron_prior_grid_generator(const Node& node) { return {std::make_shared(priors, feature_map, im_data, attrs)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.hpp index 756192d0650663..0f8d1f18da8f3c 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_prior_grid_generator(const Node& node); +ov::OutputVector experimental_detectron_prior_grid_generator(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp index f5f6f7c6ff568e..9abd04ba3d0a55 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp @@ -9,11 +9,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_roi_feature_extractor(const Node& node) { +ov::OutputVector experimental_detectron_roi_feature_extractor(const ov::frontend::onnx::Node& node) { using ROIFeatureExtractor = v6::ExperimentalDetectronROIFeatureExtractor; auto inputs = node.get_ng_inputs(); @@ -28,9 +29,7 @@ ov::OutputVector experimental_detectron_roi_feature_extractor(const Node& node) } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.hpp index baed74ec6a622c..4c0216486d2ac0 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.hpp @@ -4,20 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_roi_feature_extractor(const Node& node); +ov::OutputVector experimental_detectron_roi_feature_extractor(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp index 9bf41e5b84b89f..31a5ec05a1a698 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp @@ -9,11 +9,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_topk_rois(const Node& node) { +ov::OutputVector experimental_detectron_topk_rois(const ov::frontend::onnx::Node& node) { using TopKROIs = v6::ExperimentalDetectronTopKROIs; auto inputs = node.get_ng_inputs(); @@ -25,9 +26,7 @@ ov::OutputVector experimental_detectron_topk_rois(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.hpp index b45fbd8b668fc5..0cb0c1fc477dc8 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector experimental_detectron_topk_rois(const Node& node); +ov::OutputVector experimental_detectron_topk_rois(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp index ae49aa07a8405c..b0dcf38983194d 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp @@ -10,11 +10,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector fake_quantize(const Node& node) { +ov::OutputVector fake_quantize(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); const auto X = inputs.at(0); const auto input_low = inputs.at(1); @@ -28,9 +29,7 @@ ov::OutputVector fake_quantize(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.hpp index c9fb9f8c1ddee0..599a6d3c4ef6d3 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector fake_quantize(const Node& node); +ov::OutputVector fake_quantize(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp index a3b824e6d6e002..5f833b54b373ff 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp @@ -14,8 +14,9 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { @@ -35,7 +36,7 @@ void validate_generate_proposals_inputs(const ov::OutputVector& inputs) { } } // namespace -ov::OutputVector generate_proposals(const Node& node) { +ov::OutputVector generate_proposals(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); validate_generate_proposals_inputs(inputs); @@ -67,5 +68,6 @@ ov::OutputVector generate_proposals(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.hpp index 2df955bec7c27e..d3d57ae9280e0d 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.hpp @@ -4,17 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector generate_proposals(const Node& node); +ov::OutputVector generate_proposals(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp index 0b5d3b4ef62b9e..4ac45fe6506b51 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp @@ -11,11 +11,12 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector group_norm(const Node& node) { +ov::OutputVector group_norm(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 3, "Invalid number of inputs. Expected 3, actual " + std::to_string(inputs.size())); @@ -38,9 +39,7 @@ ov::OutputVector group_norm(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.hpp index 9916bef453c53b..d75e2b91d32d66 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.hpp @@ -4,23 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector group_norm(const Node& node); +ov::OutputVector group_norm(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph - -// namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp index 8486ba73dd9656..8faacef25e1f80 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp @@ -15,11 +15,12 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector normalize(const Node& node) { +ov::OutputVector normalize(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Invalid number of inputs"); @@ -64,9 +65,7 @@ ov::OutputVector normalize(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.hpp index 83f9d5ee9c031e..cdce213ac65ea1 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.hpp @@ -4,20 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector normalize(const Node& node); +ov::OutputVector normalize(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp index 16f70a7e7811c9..6106d441194cb4 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp @@ -17,8 +17,9 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace detail { namespace { @@ -34,7 +35,7 @@ std::shared_ptr make_slice(std::shared_ptr node, int } // namespace detail namespace set_1 { -ov::OutputVector prior_box(const Node& node) { +ov::OutputVector prior_box(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Invalid number of inputs"); @@ -65,7 +66,7 @@ ov::OutputVector prior_box(const Node& node) { axes)}; } -ov::OutputVector prior_box_clustered(const Node& node) { +ov::OutputVector prior_box_clustered(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Invalid number of inputs"); @@ -105,9 +106,7 @@ ov::OutputVector prior_box_clustered(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.hpp index 2cbea3190a3025..a52e042dc7fc9e 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.hpp @@ -4,23 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector prior_box(const Node& node); +ov::OutputVector prior_box(const ov::frontend::onnx::Node& node); -ov::OutputVector prior_box_clustered(const Node& node); +ov::OutputVector prior_box_clustered(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp index 8172ab2bc1e4fe..ff4f8f1351ba92 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp @@ -12,16 +12,17 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector swish(const Node& node) { +ov::OutputVector swish(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; ov::Output beta; if (ng_inputs.size() > 1) { - beta = ngraph::onnx_import::reshape::interpret_as_scalar(ng_inputs.at(1)); + beta = ov::frontend::onnx::reshape::interpret_as_scalar(ng_inputs.at(1)); } else { beta = v0::Constant::create(ov::element::f32, ov::Shape{}, {1.0}); } @@ -31,7 +32,6 @@ ov::OutputVector swish(const Node& node) { } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.hpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.hpp index d4b8553474bcc5..3129e194654f4d 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.hpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.hpp @@ -4,20 +4,16 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector swish(const Node& node); +ov::OutputVector swish(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/pad.cpp b/src/frontends/onnx/frontend/src/op/pad.cpp index 329b1698076a71..31604b33bb3e71 100644 --- a/src/frontends/onnx/frontend/src/op/pad.cpp +++ b/src/frontends/onnx/frontend/src/op/pad.cpp @@ -32,12 +32,12 @@ ov::op::PadMode get_pad_mode(std::string mode) { } // namespace using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector pad(const Node& node) { +ov::OutputVector pad(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); const auto data_rank = node.get_ng_inputs().at(0).get_partial_shape().rank(); @@ -62,7 +62,7 @@ ov::OutputVector pad(const Node& node) { } // namespace set_1 namespace set_11 { -ov::OutputVector pad(const Node& node) { +ov::OutputVector pad(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); const auto& data = inputs[0]; const auto& pads = inputs[1]; @@ -100,10 +100,7 @@ ov::OutputVector pad(const Node& node) { } } // namespace set_11 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/pad.hpp b/src/frontends/onnx/frontend/src/op/pad.hpp index ac2396db8b3c93..da9da5437f305f 100644 --- a/src/frontends/onnx/frontend/src/op/pad.hpp +++ b/src/frontends/onnx/frontend/src/op/pad.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector pad(const Node& node); +ov::OutputVector pad(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_11 { -ov::OutputVector pad(const Node& node); +ov::OutputVector pad(const ov::frontend::onnx::Node& node); } // namespace set_11 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/pow.cpp b/src/frontends/onnx/frontend/src/op/pow.cpp index 8343831cc29563..1b32e4ac37d97a 100644 --- a/src/frontends/onnx/frontend/src/op/pow.cpp +++ b/src/frontends/onnx/frontend/src/op/pow.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector pow(const Node& node) { +ov::OutputVector pow(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Power operation requires 2 inputs. Got: ", inputs.size()); @@ -36,10 +36,7 @@ ov::OutputVector pow(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/pow.hpp b/src/frontends/onnx/frontend/src/op/pow.hpp index 5de29ba1bb2741..6559a683e3f7e3 100644 --- a/src/frontends/onnx/frontend/src/op/pow.hpp +++ b/src/frontends/onnx/frontend/src/op/pow.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector pow(const Node& node); +ov::OutputVector pow(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/prelu.cpp b/src/frontends/onnx/frontend/src/op/prelu.cpp index bbc4c2f3ed8b59..74ebd4210c1fc6 100644 --- a/src/frontends/onnx/frontend/src/op/prelu.cpp +++ b/src/frontends/onnx/frontend/src/op/prelu.cpp @@ -8,12 +8,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector prelu(const Node& node) { +ov::OutputVector prelu(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; const auto& data = ng_inputs.at(0); const auto& slope = ng_inputs.at(1); @@ -21,10 +21,7 @@ ov::OutputVector prelu(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/prelu.hpp b/src/frontends/onnx/frontend/src/op/prelu.hpp index 2d0530b57fc88e..e7b92c46cd388d 100644 --- a/src/frontends/onnx/frontend/src/op/prelu.hpp +++ b/src/frontends/onnx/frontend/src/op/prelu.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector prelu(const Node& node); +ov::OutputVector prelu(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp b/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp index 3c86985429dc10..20b2bc06b4faff 100644 --- a/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp +++ b/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp @@ -17,12 +17,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector qlinear_conv(const Node& node) { +ov::OutputVector qlinear_conv(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); auto x = inputs.at(0); @@ -60,10 +60,7 @@ ov::OutputVector qlinear_conv(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/qlinear_conv.hpp b/src/frontends/onnx/frontend/src/op/qlinear_conv.hpp index 37a01970d3b821..b89911a421cd61 100644 --- a/src/frontends/onnx/frontend/src/op/qlinear_conv.hpp +++ b/src/frontends/onnx/frontend/src/op/qlinear_conv.hpp @@ -7,13 +7,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX QLinearConv operation. @@ -22,11 +20,10 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX quantizied /// convolution operation. -ov::OutputVector qlinear_conv(const Node& node); +ov::OutputVector qlinear_conv(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp b/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp index 5244e578f3bfe4..5320dfd9b98b0c 100644 --- a/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp +++ b/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp @@ -12,12 +12,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector qlinear_matmul(const Node& node) { +ov::OutputVector qlinear_matmul(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); const auto& a = inputs.at(0); @@ -50,6 +50,6 @@ ov::OutputVector qlinear_matmul(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/qlinear_matmul.hpp b/src/frontends/onnx/frontend/src/op/qlinear_matmul.hpp index 98d3f92f8b0878..6d117a6159715c 100644 --- a/src/frontends/onnx/frontend/src/op/qlinear_matmul.hpp +++ b/src/frontends/onnx/frontend/src/op/qlinear_matmul.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX QLinearMatMul operation. @@ -19,9 +17,9 @@ namespace set_1 { /// /// \return The vector containing OV nodes producing output of ONNX quantizied /// matrix multiplication operation. -ov::OutputVector qlinear_matmul(const Node& node); +ov::OutputVector qlinear_matmul(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/quant_conv.cpp b/src/frontends/onnx/frontend/src/op/quant_conv.cpp index 0447dc11319af2..a913399e378393 100644 --- a/src/frontends/onnx/frontend/src/op/quant_conv.cpp +++ b/src/frontends/onnx/frontend/src/op/quant_conv.cpp @@ -176,7 +176,7 @@ namespace ngraph } // namespace - ov::OutputVector quant_conv(const Node& node) + ov::OutputVector quant_conv(const ov::frontend::onnx::Node& node) { const ov::OutputVector& inputs = node.get_ng_inputs(); auto data = inputs.at(0); @@ -268,8 +268,8 @@ namespace ngraph } // namespace op - } // namespace onnx_import - -} // namespace ngraph + } // namespace onnx +} // namespace frontend +} // namespace ov #endif diff --git a/src/frontends/onnx/frontend/src/op/quant_conv.hpp b/src/frontends/onnx/frontend/src/op/quant_conv.hpp index fae89b8d917af1..38135b34649885 100644 --- a/src/frontends/onnx/frontend/src/op/quant_conv.hpp +++ b/src/frontends/onnx/frontend/src/op/quant_conv.hpp @@ -7,13 +7,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX Quant Conv operation. @@ -22,13 +20,10 @@ namespace set_1 { /// /// \return The vector containing Ngraph nodes producing output of ONNX quantizied /// convolution operation. -ov::OutputVector quant_conv(const Node& node); +ov::OutputVector quant_conv(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp index 4d507a377a9d2e..7e1635a1620624 100644 --- a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp @@ -17,9 +17,9 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace detail { namespace { @@ -139,7 +139,7 @@ std::shared_ptr make_fake_quantize(const ov::Output& y_scale } // namespace detail namespace set_1 { -ov::OutputVector quantize_linear(const Node& node) { +ov::OutputVector quantize_linear(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; auto x = inputs.at(0); auto y_scale = inputs.at(1); @@ -160,7 +160,7 @@ ov::OutputVector quantize_linear(ov::Output x, ov::Output y_zero_point, int64_t axis, Node node) { - namespace detail = ngraph::onnx_import::op::detail; + namespace detail = ov::frontend::onnx::op::detail; x = detail::validate_data(node, x); detail::validate_zero_point_type(node, y_zero_point); @@ -207,7 +207,7 @@ ov::OutputVector quantize_linear(ov::Output x, } } // namespace -ov::OutputVector quantize_linear(const Node& node) { +ov::OutputVector quantize_linear(const ov::frontend::onnx::Node& node) { const ov::OutputVector inputs{node.get_ng_inputs()}; FRONT_END_GENERAL_CHECK(2 <= inputs.size() && inputs.size() <= 3, @@ -228,10 +228,7 @@ ov::OutputVector quantize_linear(const Node& node) { return quantize_linear(x, scale, zero_point, node.get_attribute_value("axis", 1), node); } } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/quantize_linear.hpp b/src/frontends/onnx/frontend/src/op/quantize_linear.hpp index 480a4aee6863ab..6460545b937618 100644 --- a/src/frontends/onnx/frontend/src/op/quantize_linear.hpp +++ b/src/frontends/onnx/frontend/src/op/quantize_linear.hpp @@ -4,14 +4,12 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace detail { std::shared_ptr make_fake_quantize(const ov::Output& y_scale, @@ -19,19 +17,16 @@ std::shared_ptr make_fake_quantize(const ov::Output& y_scale const ov::Output& data); } namespace set_1 { -ov::OutputVector quantize_linear(const Node& node); +ov::OutputVector quantize_linear(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_13 { -ov::OutputVector quantize_linear(const Node& node); +ov::OutputVector quantize_linear(const ov::frontend::onnx::Node& node); } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_normal.cpp b/src/frontends/onnx/frontend/src/op/random_normal.cpp index 617a1cb20cd5bf..8dde43a12fde30 100644 --- a/src/frontends/onnx/frontend/src/op/random_normal.cpp +++ b/src/frontends/onnx/frontend/src/op/random_normal.cpp @@ -10,19 +10,21 @@ #include "utils/common.hpp" using namespace ov::op; +using ::ONNX_NAMESPACE::TensorProto_DataType; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_normal(const Node& node) { +ov::OutputVector random_normal(const ov::frontend::onnx::Node& node) { CHECK_VALID_NODE(node, node.has_attribute("shape"), "RandomNormal operator must specify a 'shape' attribute."); const auto dtype = - node.get_attribute_value("dtype", static_cast(ONNX_NAMESPACE::TensorProto_DataType_FLOAT)); + node.get_attribute_value("dtype", + static_cast(TensorProto_DataType::TensorProto_DataType_FLOAT)); const auto target_type = common::get_ov_element_type(dtype); const auto mean = node.get_attribute_value("mean", 0.0f); @@ -38,6 +40,6 @@ ov::OutputVector random_normal(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_normal.hpp b/src/frontends/onnx/frontend/src/op/random_normal.hpp index 4c15b5b3fa5bb2..c6f4b6b86ebcfd 100644 --- a/src/frontends/onnx/frontend/src/op/random_normal.hpp +++ b/src/frontends/onnx/frontend/src/op/random_normal.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_normal(const Node& node); +ov::OutputVector random_normal(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_normal_like.cpp b/src/frontends/onnx/frontend/src/op/random_normal_like.cpp index c36767f4beb6f8..d5e70ea3d051fd 100644 --- a/src/frontends/onnx/frontend/src/op/random_normal_like.cpp +++ b/src/frontends/onnx/frontend/src/op/random_normal_like.cpp @@ -11,13 +11,13 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_normal_like(const Node& node) { +ov::OutputVector random_normal_like(const ov::frontend::onnx::Node& node) { const auto input = node.get_ng_inputs().at(0); ov::element::Type target_type; @@ -42,6 +42,6 @@ ov::OutputVector random_normal_like(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_normal_like.hpp b/src/frontends/onnx/frontend/src/op/random_normal_like.hpp index 5b3d294952d872..2359e962bec1df 100644 --- a/src/frontends/onnx/frontend/src/op/random_normal_like.hpp +++ b/src/frontends/onnx/frontend/src/op/random_normal_like.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_normal_like(const Node& node); +ov::OutputVector random_normal_like(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_uniform.cpp b/src/frontends/onnx/frontend/src/op/random_uniform.cpp index 6db3217a38b8a2..54094940845e6c 100644 --- a/src/frontends/onnx/frontend/src/op/random_uniform.cpp +++ b/src/frontends/onnx/frontend/src/op/random_uniform.cpp @@ -9,18 +9,20 @@ #include "utils/common.hpp" using namespace ov::op; +using ::ONNX_NAMESPACE::TensorProto_DataType; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_uniform(const Node& node) { +ov::OutputVector random_uniform(const ov::frontend::onnx::Node& node) { CHECK_VALID_NODE(node, node.has_attribute("shape"), "RandomUniform operator must specify a 'shape' attribute."); const auto dtype = - node.get_attribute_value("dtype", static_cast(ONNX_NAMESPACE::TensorProto_DataType_FLOAT)); + node.get_attribute_value("dtype", + static_cast(TensorProto_DataType::TensorProto_DataType_FLOAT)); const auto high_const = node.get_attribute_as_constant("high", 1.0f); const auto low_const = node.get_attribute_as_constant("low", 0.0f); const auto seed = node.get_attribute_value("seed", 0.0f); @@ -41,6 +43,6 @@ ov::OutputVector random_uniform(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_uniform.hpp b/src/frontends/onnx/frontend/src/op/random_uniform.hpp index 685abf1b9ff792..a3ff62f13bb72d 100644 --- a/src/frontends/onnx/frontend/src/op/random_uniform.hpp +++ b/src/frontends/onnx/frontend/src/op/random_uniform.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_uniform(const Node& node); +ov::OutputVector random_uniform(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp b/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp index 3c15a177b23548..df0027b17423ee 100644 --- a/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp +++ b/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp @@ -11,13 +11,13 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_uniform_like(const Node& node) { +ov::OutputVector random_uniform_like(const ov::frontend::onnx::Node& node) { ov::OutputVector inputs{node.get_ng_inputs()}; const auto input = inputs.at(0); @@ -48,6 +48,6 @@ ov::OutputVector random_uniform_like(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/random_uniform_like.hpp b/src/frontends/onnx/frontend/src/op/random_uniform_like.hpp index e01cb2a48c6aed..8f5c52f8775b90 100644 --- a/src/frontends/onnx/frontend/src/op/random_uniform_like.hpp +++ b/src/frontends/onnx/frontend/src/op/random_uniform_like.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector random_uniform_like(const Node& node); +ov::OutputVector random_uniform_like(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/range.cpp b/src/frontends/onnx/frontend/src/op/range.cpp index c38e946d6f334f..1f73d0942b6704 100644 --- a/src/frontends/onnx/frontend/src/op/range.cpp +++ b/src/frontends/onnx/frontend/src/op/range.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector range(const Node& node) { +ov::OutputVector range(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); CHECK_VALID_NODE(node, inputs.size() >= 3, "Minimum 3 inputs are required. Got: ", inputs.size()); @@ -43,7 +43,6 @@ ov::OutputVector range(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/range.hpp b/src/frontends/onnx/frontend/src/op/range.hpp index 0e43e3651eaf6a..f5117a55f4f1eb 100644 --- a/src/frontends/onnx/frontend/src/op/range.hpp +++ b/src/frontends/onnx/frontend/src/op/range.hpp @@ -4,20 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector range(const Node& node); +ov::OutputVector range(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reciprocal.cpp b/src/frontends/onnx/frontend/src/op/reciprocal.cpp index 6019345456b8a3..f990550509ae5c 100644 --- a/src/frontends/onnx/frontend/src/op/reciprocal.cpp +++ b/src/frontends/onnx/frontend/src/op/reciprocal.cpp @@ -10,12 +10,12 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector reciprocal(const Node& node) { +ov::OutputVector reciprocal(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); auto one_node = v0::Constant::create(data.get_element_type(), ov::Shape{}, {1}); @@ -23,10 +23,7 @@ ov::OutputVector reciprocal(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reciprocal.hpp b/src/frontends/onnx/frontend/src/op/reciprocal.hpp index 618d45ee0bc3bf..9f59c8c0d3fd65 100644 --- a/src/frontends/onnx/frontend/src/op/reciprocal.hpp +++ b/src/frontends/onnx/frontend/src/op/reciprocal.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector reciprocal(const Node& node); +ov::OutputVector reciprocal(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reduce.cpp b/src/frontends/onnx/frontend/src/op/reduce.cpp index 408e7b0b66ca80..711eee13b6f9da 100644 --- a/src/frontends/onnx/frontend/src/op/reduce.cpp +++ b/src/frontends/onnx/frontend/src/op/reduce.cpp @@ -26,9 +26,9 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace { std::shared_ptr get_dynamic_all_axes_range(const Node& node) { @@ -71,7 +71,7 @@ std::shared_ptr get_reduction_axes_from_attr(const Node& node) { if (reduction_axes.empty()) { if (input_rank.is_static()) { - reduction_axes = onnx_import::common::get_monotonic_range(input_rank.get_length()); + reduction_axes = ov::frontend::onnx::common::get_monotonic_range(input_rank.get_length()); } else { return get_dynamic_all_axes_range(node); } @@ -106,62 +106,59 @@ std::shared_ptr make_ng_reduction_op(const Node& node, } // namespace namespace set_13 { -ov::OutputVector reduce_sum(const Node& node) { +ov::OutputVector reduce_sum(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0), false)}; } } // namespace set_13 namespace set_1 { -ov::OutputVector reduce_log_sum(const Node& node) { +ov::OutputVector reduce_log_sum(const ov::frontend::onnx::Node& node) { const ov::Output sum_node = make_ng_reduction_op(node, node.get_ng_inputs().at(0)); return {std::make_shared(sum_node)}; } -ov::OutputVector reduce_log_sum_exp(const Node& node) { +ov::OutputVector reduce_log_sum_exp(const ov::frontend::onnx::Node& node) { const auto exp_node = std::make_shared(node.get_ng_inputs().at(0)); const ov::Output sum_node = make_ng_reduction_op(node, exp_node); return {std::make_shared(sum_node)}; } -ov::OutputVector reduce_l1(const Node& node) { +ov::OutputVector reduce_l1(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; } -ov::OutputVector reduce_l2(const Node& node) { +ov::OutputVector reduce_l2(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; } -ov::OutputVector reduce_max(const Node& node) { +ov::OutputVector reduce_max(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; } -ov::OutputVector reduce_mean(const Node& node) { +ov::OutputVector reduce_mean(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; } -ov::OutputVector reduce_min(const Node& node) { +ov::OutputVector reduce_min(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; } -ov::OutputVector reduce_prod(const Node& node) { +ov::OutputVector reduce_prod(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; } -ov::OutputVector reduce_sum(const Node& node) { +ov::OutputVector reduce_sum(const ov::frontend::onnx::Node& node) { return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; } -ov::OutputVector reduce_sum_square(const Node& node) { +ov::OutputVector reduce_sum_square(const ov::frontend::onnx::Node& node) { const auto input = ov::Output{node.get_ng_inputs().at(0)}; const auto square_node = std::make_shared(input, input); return {make_ng_reduction_op(node, square_node)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reduce.hpp b/src/frontends/onnx/frontend/src/op/reduce.hpp index 38eeca9de52de5..5c5f4a4a1ae50c 100644 --- a/src/frontends/onnx/frontend/src/op/reduce.hpp +++ b/src/frontends/onnx/frontend/src/op/reduce.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_13 { /// \brief Compute the sum of the input tensor's elements along the provided @@ -25,7 +23,7 @@ namespace set_13 { /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_sum(const Node& node); +ov::OutputVector reduce_sum(const ov::frontend::onnx::Node& node); } // namespace set_13 namespace set_1 { /// \brief Compute the log sum of the input tensor's elements along the @@ -40,7 +38,7 @@ namespace set_1 { /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_log_sum(const Node& node); +ov::OutputVector reduce_log_sum(const ov::frontend::onnx::Node& node); /// \brief Compute the log sum exponent of the input tensor's elements along /// the provided axes. @@ -54,7 +52,7 @@ ov::OutputVector reduce_log_sum(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_log_sum_exp(const Node& node); +ov::OutputVector reduce_log_sum_exp(const ov::frontend::onnx::Node& node); /// \brief Compute the L1 norm of the input tensor's element along the provided /// axes. @@ -68,7 +66,7 @@ ov::OutputVector reduce_log_sum_exp(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_l1(const Node& node); +ov::OutputVector reduce_l1(const ov::frontend::onnx::Node& node); /// \brief Compute the L2 norm of the input tensor's element along the provided /// axes. @@ -82,7 +80,7 @@ ov::OutputVector reduce_l1(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_l2(const Node& node); +ov::OutputVector reduce_l2(const ov::frontend::onnx::Node& node); /// \brief Compute the maximum value of the input tensor's elements along the /// provided axes. @@ -96,7 +94,7 @@ ov::OutputVector reduce_l2(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_max(const Node& node); +ov::OutputVector reduce_max(const ov::frontend::onnx::Node& node); /// \brief Compute the mean value of the input tensor's elements along the /// provided axes. @@ -110,7 +108,7 @@ ov::OutputVector reduce_max(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_mean(const Node& node); +ov::OutputVector reduce_mean(const ov::frontend::onnx::Node& node); /// \brief Compute the minimum value of the input tensor's elements along the /// provided axes. @@ -124,7 +122,7 @@ ov::OutputVector reduce_mean(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_min(const Node& node); +ov::OutputVector reduce_min(const ov::frontend::onnx::Node& node); /// \brief Compute the product of the input tensor's elements along the /// provided axes. @@ -138,7 +136,7 @@ ov::OutputVector reduce_min(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_prod(const Node& node); +ov::OutputVector reduce_prod(const ov::frontend::onnx::Node& node); /// \brief Compute the sum of the input tensor's elements along the provided /// axes. @@ -152,7 +150,7 @@ ov::OutputVector reduce_prod(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_sum(const Node& node); +ov::OutputVector reduce_sum(const ov::frontend::onnx::Node& node); /// \brief Compute the sum square of the input tensor's element along the /// provided axes. @@ -166,13 +164,10 @@ ov::OutputVector reduce_sum(const Node& node); /// /// \return The OV node equivalent of the ONNX operation. /// -ov::OutputVector reduce_sum_square(const Node& node); +ov::OutputVector reduce_sum_square(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/relu.hpp b/src/frontends/onnx/frontend/src/op/relu.hpp index cfbb4b3afc0bf8..dd319d5509e3f6 100644 --- a/src/frontends/onnx/frontend/src/op/relu.hpp +++ b/src/frontends/onnx/frontend/src/op/relu.hpp @@ -4,26 +4,21 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/relu.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector relu(const Node& node) { +inline ov::OutputVector relu(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; return {std::make_shared(ng_inputs.at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reshape.cpp b/src/frontends/onnx/frontend/src/op/reshape.cpp index 76ece6d66bfa89..4019d4827b8a06 100644 --- a/src/frontends/onnx/frontend/src/op/reshape.cpp +++ b/src/frontends/onnx/frontend/src/op/reshape.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector reshape(const Node& node) { +ov::OutputVector reshape(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; const auto data = ng_inputs.at(0); @@ -35,10 +35,7 @@ ov::OutputVector reshape(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reshape.hpp b/src/frontends/onnx/frontend/src/op/reshape.hpp index effab548e37d7b..16315e2872c394 100644 --- a/src/frontends/onnx/frontend/src/op/reshape.hpp +++ b/src/frontends/onnx/frontend/src/op/reshape.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// @@ -20,13 +18,10 @@ namespace set_1 { /// /// \return OV node representing this operation. /// -ov::OutputVector reshape(const Node& node); +ov::OutputVector reshape(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/resize.cpp b/src/frontends/onnx/frontend/src/op/resize.cpp index 1727c1274e631e..d30f5e33a24b01 100644 --- a/src/frontends/onnx/frontend/src/op/resize.cpp +++ b/src/frontends/onnx/frontend/src/op/resize.cpp @@ -11,9 +11,9 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace { static const std::unordered_set supported_modes = {"nearest", "linear", "cubic"}; @@ -59,7 +59,7 @@ static int mode_as_int(const std::map& converting_map, const s using InterpolateAttrs = v11::Interpolate::InterpolateAttrs; -InterpolateAttrs get_resize_attrs(const onnx_import::Node& node) { +InterpolateAttrs get_resize_attrs(const ov::frontend::onnx::Node& node) { auto get_str_attr = [&node](const std::string& name, const std::string& default_value) { return node.get_attribute_value(name, default_value); }; @@ -112,7 +112,7 @@ InterpolateAttrs get_resize_attrs(const onnx_import::Node& node) { } // namespace namespace set_11 { -ov::OutputVector resize(const onnx_import::Node& node) { +ov::OutputVector resize(const ov::frontend::onnx::Node& node) { // roi input (inputs.at(2)) is ignored because it is used only // in "tf_crop_and_resize" which is not handled now const auto inputs = node.get_ng_inputs(); @@ -133,7 +133,7 @@ ov::OutputVector resize(const onnx_import::Node& node) { } // namespace set_11 namespace set_1 { -ov::OutputVector resize(const onnx_import::Node& node) { +ov::OutputVector resize(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); const auto& data = inputs.at(0); const auto& scales = inputs.at(1); @@ -152,6 +152,6 @@ ov::OutputVector resize(const onnx_import::Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/resize.hpp b/src/frontends/onnx/frontend/src/op/resize.hpp index c3287f3b7c212d..625afedbf5d5c4 100644 --- a/src/frontends/onnx/frontend/src/op/resize.hpp +++ b/src/frontends/onnx/frontend/src/op/resize.hpp @@ -4,26 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector resize(const Node& node); +ov::OutputVector resize(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_11 { -ov::OutputVector resize(const Node& node); +ov::OutputVector resize(const ov::frontend::onnx::Node& node); } } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp b/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp index 89d3e027992fa1..602a534a5e2900 100644 --- a/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp +++ b/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp @@ -13,12 +13,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector reverse_sequence(const Node& node) { +ov::OutputVector reverse_sequence(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const auto sequence_lengths = node.get_ng_inputs().at(1); @@ -48,10 +48,7 @@ ov::OutputVector reverse_sequence(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/reverse_sequence.hpp b/src/frontends/onnx/frontend/src/op/reverse_sequence.hpp index 87d3b7d5d31eb2..be9891adee8b83 100644 --- a/src/frontends/onnx/frontend/src/op/reverse_sequence.hpp +++ b/src/frontends/onnx/frontend/src/op/reverse_sequence.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector reverse_sequence(const Node& node); +ov::OutputVector reverse_sequence(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/rnn.cpp b/src/frontends/onnx/frontend/src/op/rnn.cpp index 54655093a3cfbe..2d9c6aa9287601 100644 --- a/src/frontends/onnx/frontend/src/op/rnn.cpp +++ b/src/frontends/onnx/frontend/src/op/rnn.cpp @@ -10,14 +10,14 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { namespace { struct RNNInputMap : public recurrent::OpInputMap { - RNNInputMap(const onnx_import::Node& node, std::size_t gates_count) : OpInputMap(node, gates_count) {} + RNNInputMap(const ov::frontend::onnx::Node& node, std::size_t gates_count) : OpInputMap(node, gates_count) {} virtual ~RNNInputMap() = default; }; @@ -29,7 +29,7 @@ struct RNNAttributes : public recurrent::OpAttributes { }; } // namespace -ov::OutputVector rnn(const Node& node) { +ov::OutputVector rnn(const ov::frontend::onnx::Node& node) { constexpr std::size_t gates_count = 1; RNNInputMap input_map{node, gates_count}; RNNAttributes attributes{node}; @@ -54,6 +54,6 @@ ov::OutputVector rnn(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/rnn.hpp b/src/frontends/onnx/frontend/src/op/rnn.hpp index d5cbec3e48111f..926b08d382d332 100644 --- a/src/frontends/onnx/frontend/src/op/rnn.hpp +++ b/src/frontends/onnx/frontend/src/op/rnn.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector rnn(const Node& node); +ov::OutputVector rnn(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/roi_align.cpp b/src/frontends/onnx/frontend/src/op/roi_align.cpp index 38524125f3045c..a32f91c45dedef 100644 --- a/src/frontends/onnx/frontend/src/op/roi_align.cpp +++ b/src/frontends/onnx/frontend/src/op/roi_align.cpp @@ -9,14 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { - namespace set_1 { - -ov::OutputVector roi_align(const Node& node) { +ov::OutputVector roi_align(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 3, "The RoiAlign operator expects 3 inputs. Got: ", inputs.size()); @@ -45,7 +43,7 @@ ov::OutputVector roi_align(const Node& node) { } } // namespace set_1 namespace set_16 { -ov::OutputVector roi_align(const Node& node) { +ov::OutputVector roi_align(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 3, "The RoiAlign operator expects 3 inputs. Got: ", inputs.size()); @@ -80,10 +78,7 @@ ov::OutputVector roi_align(const Node& node) { aligned_mode)}; } } // namespace set_16 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/roi_align.hpp b/src/frontends/onnx/frontend/src/op/roi_align.hpp index 37643c272e6f9b..5b4c0305ef2093 100644 --- a/src/frontends/onnx/frontend/src/op/roi_align.hpp +++ b/src/frontends/onnx/frontend/src/op/roi_align.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector roi_align(const Node& node); +ov::OutputVector roi_align(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_16 { -ov::OutputVector roi_align(const Node& node); +ov::OutputVector roi_align(const ov::frontend::onnx::Node& node); } // namespace set_16 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/round.cpp b/src/frontends/onnx/frontend/src/op/round.cpp index 8007b76398afa8..379150149cab51 100644 --- a/src/frontends/onnx/frontend/src/op/round.cpp +++ b/src/frontends/onnx/frontend/src/op/round.cpp @@ -11,19 +11,16 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector round(const Node& node) { +ov::OutputVector round(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), v5::Round::RoundMode::HALF_TO_EVEN)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/round.hpp b/src/frontends/onnx/frontend/src/op/round.hpp index bef374ae9edad6..8cabccbe4fd616 100644 --- a/src/frontends/onnx/frontend/src/op/round.hpp +++ b/src/frontends/onnx/frontend/src/op/round.hpp @@ -7,22 +7,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector round(const Node& node); +ov::OutputVector round(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/scan.cpp b/src/frontends/onnx/frontend/src/op/scan.cpp index 12903aaf70fbdd..35a0d0ee6df038 100644 --- a/src/frontends/onnx/frontend/src/op/scan.cpp +++ b/src/frontends/onnx/frontend/src/op/scan.cpp @@ -16,9 +16,9 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace { @@ -114,7 +114,7 @@ ov::OutputVector scan_to_tensor_iterator(const ov::OutputVector& node_inputs, return outputs; } -ov::OutputVector import_onnx_scan(const Node& node, +ov::OutputVector import_onnx_scan(const ov::frontend::onnx::Node& node, int64_t default_axis, int64_t in_offset, std::string&& in_directions_attr_name) { @@ -158,7 +158,7 @@ ov::OutputVector import_onnx_scan(const Node& node, namespace set_1 { -ov::OutputVector scan(const Node& node) { +ov::OutputVector scan(const ov::frontend::onnx::Node& node) { // ONNX Scan-8 can have optional `sequence_lens` input, // and sequence scan_input axis is assumed to be always 1. OPENVINO_ASSERT(ov::op::util::is_null(node.get_ng_inputs().at(0)), @@ -171,7 +171,7 @@ ov::OutputVector scan(const Node& node) { namespace set_9 { -ov::OutputVector scan(const Node& node) { +ov::OutputVector scan(const ov::frontend::onnx::Node& node) { // Since ONNX Scan-9 the optional `sequence_lens input` was removed, // new attributes to specify input/output axes and directions were added. return import_onnx_scan(node, 0, 0, "scan_input_directions"); @@ -179,6 +179,6 @@ ov::OutputVector scan(const Node& node) { } // namespace set_9 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/scan.hpp b/src/frontends/onnx/frontend/src/op/scan.hpp index 9b45e0aeeef237..41cb62fa51dcc6 100644 --- a/src/frontends/onnx/frontend/src/op/scan.hpp +++ b/src/frontends/onnx/frontend/src/op/scan.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Creates OpenVino node representing ONNX Scan operator. @@ -22,16 +20,13 @@ namespace set_1 { /// /// \return ov::OutputVector of resulting OpenVino nodes. /// -ov::OutputVector scan(const Node& node); +ov::OutputVector scan(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_9 { -ov::OutputVector scan(const Node& node); +ov::OutputVector scan(const ov::frontend::onnx::Node& node); } // namespace set_9 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/scatter_elements.cpp b/src/frontends/onnx/frontend/src/op/scatter_elements.cpp index 993dca05f49e56..ed53d8357c5003 100644 --- a/src/frontends/onnx/frontend/src/op/scatter_elements.cpp +++ b/src/frontends/onnx/frontend/src/op/scatter_elements.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector scatter_elements(const Node& node) { +ov::OutputVector scatter_elements(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const auto indices = node.get_ng_inputs().at(1); const auto updates = node.get_ng_inputs().at(2); @@ -47,10 +47,7 @@ ov::OutputVector scatter_elements(const Node& node) { return {std::make_shared(data, indices, updates, axis_node, reduction_ov)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/scatter_elements.hpp b/src/frontends/onnx/frontend/src/op/scatter_elements.hpp index fa6dfcdba5e4f9..4b7e0e608a9a7d 100644 --- a/src/frontends/onnx/frontend/src/op/scatter_elements.hpp +++ b/src/frontends/onnx/frontend/src/op/scatter_elements.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector scatter_elements(const Node& node); +ov::OutputVector scatter_elements(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/scatter_nd.cpp b/src/frontends/onnx/frontend/src/op/scatter_nd.cpp index 70be4366aeb431..e1563666b10c05 100644 --- a/src/frontends/onnx/frontend/src/op/scatter_nd.cpp +++ b/src/frontends/onnx/frontend/src/op/scatter_nd.cpp @@ -12,12 +12,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector scatter_nd(const Node& node) { +ov::OutputVector scatter_nd(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; auto data = ng_inputs.at(0); auto indices = ng_inputs.at(1); @@ -34,10 +34,7 @@ ov::OutputVector scatter_nd(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/scatter_nd.hpp b/src/frontends/onnx/frontend/src/op/scatter_nd.hpp index edf94ed7b0c995..4ba3e2a8c7df00 100644 --- a/src/frontends/onnx/frontend/src/op/scatter_nd.hpp +++ b/src/frontends/onnx/frontend/src/op/scatter_nd.hpp @@ -7,22 +7,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector scatter_nd(const Node& node); +ov::OutputVector scatter_nd(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/selu.cpp b/src/frontends/onnx/frontend/src/op/selu.cpp index fe5b56bb06de48..083b056e41f1cb 100644 --- a/src/frontends/onnx/frontend/src/op/selu.cpp +++ b/src/frontends/onnx/frontend/src/op/selu.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector selu(const Node& node) { +ov::OutputVector selu(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); auto alpha = node.get_attribute_value("alpha", 1.67326319217681884765625); auto gamma = node.get_attribute_value("gamma", 1.05070102214813232421875); @@ -27,10 +27,7 @@ ov::OutputVector selu(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/selu.hpp b/src/frontends/onnx/frontend/src/op/selu.hpp index 752a4283ec827b..82ed712ce69bac 100644 --- a/src/frontends/onnx/frontend/src/op/selu.hpp +++ b/src/frontends/onnx/frontend/src/op/selu.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector selu(const Node& node); +ov::OutputVector selu(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/shape.cpp b/src/frontends/onnx/frontend/src/op/shape.cpp index 87598efd2575b5..35ad5d54fcfaeb 100644 --- a/src/frontends/onnx/frontend/src/op/shape.cpp +++ b/src/frontends/onnx/frontend/src/op/shape.cpp @@ -8,19 +8,19 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector shape(const Node& node) { +ov::OutputVector shape(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); return {std::make_shared(data)}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/shape.hpp b/src/frontends/onnx/frontend/src/op/shape.hpp index df36350baf32d4..51ba245c1efb39 100644 --- a/src/frontends/onnx/frontend/src/op/shape.hpp +++ b/src/frontends/onnx/frontend/src/op/shape.hpp @@ -4,20 +4,18 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector shape(const Node& node); +ov::OutputVector shape(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/shrink.cpp b/src/frontends/onnx/frontend/src/op/shrink.cpp index 4ffb0b2073d4f2..477c27b683b7aa 100644 --- a/src/frontends/onnx/frontend/src/op/shrink.cpp +++ b/src/frontends/onnx/frontend/src/op/shrink.cpp @@ -15,12 +15,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector shrink(const Node& node) { +ov::OutputVector shrink(const ov::frontend::onnx::Node& node) { const auto input = node.get_ng_inputs().at(0); const float bias = node.get_attribute_value("bias", 0.0f); const float lambd = node.get_attribute_value("lambd", 0.5f); @@ -65,10 +65,7 @@ ov::OutputVector shrink(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/shrink.hpp b/src/frontends/onnx/frontend/src/op/shrink.hpp index 39037059e06122..8e04c0f4fbab15 100644 --- a/src/frontends/onnx/frontend/src/op/shrink.hpp +++ b/src/frontends/onnx/frontend/src/op/shrink.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief ONNX Shrink operator @@ -19,12 +17,9 @@ namespace set_1 { /// Input values greater or equal to '-lambd' and less or equal to 'lambd' are /// zeroed-out. 'Bias' is added to the values that are less than '-lambd' /// and subtracted from values greater than 'lambd'. -ov::OutputVector shrink(const Node& node); +ov::OutputVector shrink(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/sigmoid.hpp b/src/frontends/onnx/frontend/src/op/sigmoid.hpp index 903986936d3fee..b40398d3110497 100644 --- a/src/frontends/onnx/frontend/src/op/sigmoid.hpp +++ b/src/frontends/onnx/frontend/src/op/sigmoid.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/sigmoid.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector sigmoid(const Node& node) { +inline ov::OutputVector sigmoid(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/sign.hpp b/src/frontends/onnx/frontend/src/op/sign.hpp index 8da5fd25b7ed92..88367101dbbf23 100644 --- a/src/frontends/onnx/frontend/src/op/sign.hpp +++ b/src/frontends/onnx/frontend/src/op/sign.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/sign.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector sign(const Node& node) { +inline ov::OutputVector sign(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/sin.hpp b/src/frontends/onnx/frontend/src/op/sin.hpp index 122540ad91e4d1..be093dc5e94ad1 100644 --- a/src/frontends/onnx/frontend/src/op/sin.hpp +++ b/src/frontends/onnx/frontend/src/op/sin.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/sin.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector sin(const Node& node) { +inline ov::OutputVector sin(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/sinh.hpp b/src/frontends/onnx/frontend/src/op/sinh.hpp index 91be05aa26b257..3e0e8fece3c0bb 100644 --- a/src/frontends/onnx/frontend/src/op/sinh.hpp +++ b/src/frontends/onnx/frontend/src/op/sinh.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/sinh.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector sinh(const Node& node) { +inline ov::OutputVector sinh(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/size.cpp b/src/frontends/onnx/frontend/src/op/size.cpp index 9c3b72834203bf..18c371f1dd2a18 100644 --- a/src/frontends/onnx/frontend/src/op/size.cpp +++ b/src/frontends/onnx/frontend/src/op/size.cpp @@ -11,12 +11,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector size(const Node& node) { +ov::OutputVector size(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); auto axes = v0::Constant::create(ov::element::i32, ov::Shape{}, {0}); auto input_shape = std::make_shared(data); @@ -24,10 +24,7 @@ ov::OutputVector size(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/size.hpp b/src/frontends/onnx/frontend/src/op/size.hpp index 003b16dcd986d4..8511b705f298fc 100644 --- a/src/frontends/onnx/frontend/src/op/size.hpp +++ b/src/frontends/onnx/frontend/src/op/size.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector size(const Node& node); +ov::OutputVector size(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/slice.cpp b/src/frontends/onnx/frontend/src/op/slice.cpp index bdd45fdf07ff75..3b22cfff8d0631 100644 --- a/src/frontends/onnx/frontend/src/op/slice.cpp +++ b/src/frontends/onnx/frontend/src/op/slice.cpp @@ -11,15 +11,14 @@ #include "openvino/op/slice.hpp" using namespace ov::op; - using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_10 { -ov::OutputVector slice(const Node& node) { +ov::OutputVector slice(const ov::frontend::onnx::Node& node) { using ov::op::util::is_null; ov::OutputVector inputs{node.get_ng_inputs()}; @@ -48,7 +47,7 @@ ov::OutputVector slice(const Node& node) { } // namespace set_10 namespace set_1 { -ov::OutputVector slice(const Node& node) { +ov::OutputVector slice(const ov::frontend::onnx::Node& node) { ov::Output data = node.get_ng_inputs().at(0); const auto starts_atr = node.get_attribute_value>("starts"); const auto ends = node.get_attribute_as_constant>("ends"); @@ -69,6 +68,6 @@ ov::OutputVector slice(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/slice.hpp b/src/frontends/onnx/frontend/src/op/slice.hpp index 9c8f0b355dc471..7f9e7aae4f097b 100644 --- a/src/frontends/onnx/frontend/src/op/slice.hpp +++ b/src/frontends/onnx/frontend/src/op/slice.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_10 { -ov::OutputVector slice(const Node& node); +ov::OutputVector slice(const ov::frontend::onnx::Node& node); } // namespace set_10 namespace set_1 { -ov::OutputVector slice(const Node& node); +ov::OutputVector slice(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/softmax.cpp b/src/frontends/onnx/frontend/src/op/softmax.cpp index 8ab868c9300420..e1b52595677ac1 100644 --- a/src/frontends/onnx/frontend/src/op/softmax.cpp +++ b/src/frontends/onnx/frontend/src/op/softmax.cpp @@ -13,9 +13,9 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace { std::shared_ptr onnx_softmax(const ov::Output data, const int64_t axis) { const auto coerced_data = ov::op::util::flatten(data, static_cast(axis)); @@ -28,7 +28,7 @@ std::shared_ptr onnx_softmax(const ov::Output data, const in namespace op { namespace set_1 { -ov::OutputVector softmax(const Node& node) { +ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const auto data_rank = data.get_partial_shape().rank(); FRONT_END_GENERAL_CHECK(data_rank.is_static(), "ONNX Softmax data rank needs to be known (static)"); @@ -51,7 +51,7 @@ ov::OutputVector softmax(const Node& node) { } } // namespace set_1 namespace set_11 { -ov::OutputVector softmax(const Node& node) { +ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const auto data_rank = data.get_partial_shape().rank(); FRONT_END_GENERAL_CHECK(data_rank.is_static(), "ONNX Softmax data rank needs to be known (static)"); @@ -74,7 +74,7 @@ ov::OutputVector softmax(const Node& node) { } } // namespace set_11 namespace set_13 { -ov::OutputVector softmax(const Node& node) { +ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const auto axis = node.get_attribute_value("axis", -1); @@ -83,6 +83,6 @@ ov::OutputVector softmax(const Node& node) { } } // namespace set_13 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/softmax.hpp b/src/frontends/onnx/frontend/src/op/softmax.hpp index 89cf70c2f1c136..cded80d80ec19c 100644 --- a/src/frontends/onnx/frontend/src/op/softmax.hpp +++ b/src/frontends/onnx/frontend/src/op/softmax.hpp @@ -4,31 +4,27 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector softmax(const Node& node); +ov::OutputVector softmax(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_11 { -ov::OutputVector softmax(const Node& node); +ov::OutputVector softmax(const ov::frontend::onnx::Node& node); } // namespace set_11 namespace set_13 { -ov::OutputVector softmax(const Node& node); +ov::OutputVector softmax(const ov::frontend::onnx::Node& node); } // namespace set_13 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/softplus.cpp b/src/frontends/onnx/frontend/src/op/softplus.cpp index 5578fd3ccc49b7..39175ebe13aecc 100644 --- a/src/frontends/onnx/frontend/src/op/softplus.cpp +++ b/src/frontends/onnx/frontend/src/op/softplus.cpp @@ -8,21 +8,18 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector softplus(const Node& node) { +ov::OutputVector softplus(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); return {std::make_shared(data)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/softplus.hpp b/src/frontends/onnx/frontend/src/op/softplus.hpp index 131c0fe1dc3253..911dcf6b9e2d83 100644 --- a/src/frontends/onnx/frontend/src/op/softplus.hpp +++ b/src/frontends/onnx/frontend/src/op/softplus.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector softplus(const Node& node); +ov::OutputVector softplus(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/softsign.cpp b/src/frontends/onnx/frontend/src/op/softsign.cpp index 8dbfc9b0bf5f7d..094ca5c66d39ce 100644 --- a/src/frontends/onnx/frontend/src/op/softsign.cpp +++ b/src/frontends/onnx/frontend/src/op/softsign.cpp @@ -8,16 +8,16 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector softsign(const Node& node) { +ov::OutputVector softsign(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/softsign.hpp b/src/frontends/onnx/frontend/src/op/softsign.hpp index 6948422d7c646f..931dbda573fd23 100644 --- a/src/frontends/onnx/frontend/src/op/softsign.hpp +++ b/src/frontends/onnx/frontend/src/op/softsign.hpp @@ -4,19 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector softsign(const Node& node); +ov::OutputVector softsign(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/space_to_depth.cpp b/src/frontends/onnx/frontend/src/op/space_to_depth.cpp index a1cb1e645de097..ff7cedbfb60fa2 100644 --- a/src/frontends/onnx/frontend/src/op/space_to_depth.cpp +++ b/src/frontends/onnx/frontend/src/op/space_to_depth.cpp @@ -9,24 +9,21 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector space_to_depth(const Node& node) { +ov::OutputVector space_to_depth(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); const auto& shape = data.get_partial_shape(); FRONT_END_GENERAL_CHECK(shape.rank().is_static() && shape.rank().get_length() == 4, "Input must be 4-dimensional"); std::size_t block_size = node.get_attribute_value("blocksize"); const auto mode = v0::SpaceToDepth::SpaceToDepthMode::BLOCKS_FIRST; - return ov::OutputVector{std::make_shared(data, mode, block_size)}; + return {std::make_shared(data, mode, block_size)}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/space_to_depth.hpp b/src/frontends/onnx/frontend/src/op/space_to_depth.hpp index f00e4632f90a0f..f39b6261778135 100644 --- a/src/frontends/onnx/frontend/src/op/space_to_depth.hpp +++ b/src/frontends/onnx/frontend/src/op/space_to_depth.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Permutes input tensor blocks of spatial data into depth. @@ -19,12 +17,9 @@ namespace set_1 { /// /// \return ov::OutputVector containing Tensor with shape: /// [N, C * blocksize * blocksize, H / blocksize, W / blocksize] -ov::OutputVector space_to_depth(const Node& node); +ov::OutputVector space_to_depth(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/split.cpp b/src/frontends/onnx/frontend/src/op/split.cpp index 4c50b54a665e6a..c8349d2ef76e21 100644 --- a/src/frontends/onnx/frontend/src/op/split.cpp +++ b/src/frontends/onnx/frontend/src/op/split.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector split(const Node& node) { +ov::OutputVector split(const ov::frontend::onnx::Node& node) { const auto input = node.get_ng_inputs().at(0); const auto axis = node.get_attribute_value("axis", 0); @@ -31,7 +31,7 @@ ov::OutputVector split(const Node& node) { } // namespace set_1 namespace set_13 { -ov::OutputVector split(const Node& node) { +ov::OutputVector split(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); const auto axis = node.get_attribute_value("axis", 0); @@ -46,8 +46,6 @@ ov::OutputVector split(const Node& node) { } // namespace set_13 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/split.hpp b/src/frontends/onnx/frontend/src/op/split.hpp index 2386410eed5f42..e618f0de65bf1b 100644 --- a/src/frontends/onnx/frontend/src/op/split.hpp +++ b/src/frontends/onnx/frontend/src/op/split.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector split(const Node& node); +ov::OutputVector split(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_13 { -ov::OutputVector split(const Node& node); +ov::OutputVector split(const ov::frontend::onnx::Node& node); } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/sqrt.hpp b/src/frontends/onnx/frontend/src/op/sqrt.hpp index 50a0c320e1ca2b..7051a1657613d3 100644 --- a/src/frontends/onnx/frontend/src/op/sqrt.hpp +++ b/src/frontends/onnx/frontend/src/op/sqrt.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/sqrt.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector sqrt(const Node& node) { +inline ov::OutputVector sqrt(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/squeeze.cpp b/src/frontends/onnx/frontend/src/op/squeeze.cpp index 5c03b8b128f986..ddfb6bcf3456dc 100644 --- a/src/frontends/onnx/frontend/src/op/squeeze.cpp +++ b/src/frontends/onnx/frontend/src/op/squeeze.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector squeeze(const Node& node) { +ov::OutputVector squeeze(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); const auto axes = node.get_attribute_value>("axes", {}); @@ -29,7 +29,7 @@ ov::OutputVector squeeze(const Node& node) { } // namespace set_1 namespace set_13 { -ov::OutputVector squeeze(const Node& node) { +ov::OutputVector squeeze(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); if (inputs.size() < 2) { return {std::make_shared(inputs.at(0))}; @@ -40,6 +40,6 @@ ov::OutputVector squeeze(const Node& node) { } // namespace set_13 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/squeeze.hpp b/src/frontends/onnx/frontend/src/op/squeeze.hpp index e17a497e88958b..d50b33e158b695 100644 --- a/src/frontends/onnx/frontend/src/op/squeeze.hpp +++ b/src/frontends/onnx/frontend/src/op/squeeze.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector squeeze(const Node& node); +ov::OutputVector squeeze(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_13 { -ov::OutputVector squeeze(const Node& node); +ov::OutputVector squeeze(const ov::frontend::onnx::Node& node); } // namespace set_13 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/stft.cpp b/src/frontends/onnx/frontend/src/op/stft.cpp index dc8ecfbf580d96..7b3de1d0e209ff 100644 --- a/src/frontends/onnx/frontend/src/op/stft.cpp +++ b/src/frontends/onnx/frontend/src/op/stft.cpp @@ -21,13 +21,13 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_17 { -ov::OutputVector stft(const Node& node) { +ov::OutputVector stft(const ov::frontend::onnx::Node& node) { const ov::OutputVector ng_inputs{node.get_ng_inputs()}; auto signal = ng_inputs.at(0); const auto dft_length_provided = ng_inputs.size() > 3 && !ov::op::util::is_null(ng_inputs[3]); @@ -124,10 +124,7 @@ ov::OutputVector stft(const Node& node) { } } // namespace set_17 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/stft.hpp b/src/frontends/onnx/frontend/src/op/stft.hpp index e0b1352db4b00d..3cd7358de35087 100644 --- a/src/frontends/onnx/frontend/src/op/stft.hpp +++ b/src/frontends/onnx/frontend/src/op/stft.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_17 { -ov::OutputVector stft(const Node& node); +ov::OutputVector stft(const ov::frontend::onnx::Node& node); } // namespace set_17 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/sub.hpp b/src/frontends/onnx/frontend/src/op/sub.hpp index f072b81abdfe53..219e65e649af1e 100644 --- a/src/frontends/onnx/frontend/src/op/sub.hpp +++ b/src/frontends/onnx/frontend/src/op/sub.hpp @@ -4,32 +4,27 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/subtract.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector sub(const Node& node) { +inline ov::OutputVector sub(const ov::frontend::onnx::Node& node) { return common::handle_opset6_binary_op(node); } } // namespace set_1 namespace set_7 { -inline ov::OutputVector sub(const Node& node) { +inline ov::OutputVector sub(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; } } // namespace set_7 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/sum.hpp b/src/frontends/onnx/frontend/src/op/sum.hpp index 34acb7c873e30a..2bd3c276709dc4 100644 --- a/src/frontends/onnx/frontend/src/op/sum.hpp +++ b/src/frontends/onnx/frontend/src/op/sum.hpp @@ -4,33 +4,28 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/add.hpp" #include "utils/variadic.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector sum(const Node& node) { +inline ov::OutputVector sum(const ov::frontend::onnx::Node& node) { return variadic::make_ng_variadic_op(node, ov::op::AutoBroadcastType::NONE); } } // namespace set_1 namespace set_8 { -inline ov::OutputVector sum(const Node& node) { +inline ov::OutputVector sum(const ov::frontend::onnx::Node& node) { return variadic::make_ng_variadic_op(node); } } // namespace set_8 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/tan.hpp b/src/frontends/onnx/frontend/src/op/tan.hpp index 50f7c4b5007d17..0ba2456573de66 100644 --- a/src/frontends/onnx/frontend/src/op/tan.hpp +++ b/src/frontends/onnx/frontend/src/op/tan.hpp @@ -4,24 +4,19 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/tan.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector tan(const Node& node) { +inline ov::OutputVector tan(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/tanh.hpp b/src/frontends/onnx/frontend/src/op/tanh.hpp index 2f63cf6ddb75c5..eebc01feabc87b 100644 --- a/src/frontends/onnx/frontend/src/op/tanh.hpp +++ b/src/frontends/onnx/frontend/src/op/tanh.hpp @@ -4,25 +4,20 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/tanh.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector tanh(const Node& node) { +inline ov::OutputVector tanh(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp b/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp index 7a94ab9f3f87b9..25e5ed9049f482 100644 --- a/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp +++ b/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp @@ -11,12 +11,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector thresholded_relu(const Node& node) { +ov::OutputVector thresholded_relu(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const double alpha = node.get_attribute_value("alpha", 1.0); @@ -29,10 +29,7 @@ ov::OutputVector thresholded_relu(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/thresholded_relu.hpp b/src/frontends/onnx/frontend/src/op/thresholded_relu.hpp index 41892b7605ca05..297efcfa317f3e 100644 --- a/src/frontends/onnx/frontend/src/op/thresholded_relu.hpp +++ b/src/frontends/onnx/frontend/src/op/thresholded_relu.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector thresholded_relu(const Node& node); +ov::OutputVector thresholded_relu(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/tile.cpp b/src/frontends/onnx/frontend/src/op/tile.cpp index 231b3de4d7556d..6b6556a1902c5b 100644 --- a/src/frontends/onnx/frontend/src/op/tile.cpp +++ b/src/frontends/onnx/frontend/src/op/tile.cpp @@ -10,12 +10,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector tile(const Node& node) { +ov::OutputVector tile(const ov::frontend::onnx::Node& node) { auto input = node.get_ng_inputs().at(0); auto repeats = node.get_ng_inputs().at(1); @@ -27,10 +27,7 @@ ov::OutputVector tile(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/tile.hpp b/src/frontends/onnx/frontend/src/op/tile.hpp index 5aff2d12a153dd..106f38970ab7f5 100644 --- a/src/frontends/onnx/frontend/src/op/tile.hpp +++ b/src/frontends/onnx/frontend/src/op/tile.hpp @@ -4,26 +4,21 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX Tile operation. /// /// \param node The ONNX node object representing this operation. /// \return The vector containing OV a node producing the output of the Tile op. -ov::OutputVector tile(const Node& node); +ov::OutputVector tile(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/topk.cpp b/src/frontends/onnx/frontend/src/op/topk.cpp index c945b2c98e2b93..8104608794d8d3 100644 --- a/src/frontends/onnx/frontend/src/op/topk.cpp +++ b/src/frontends/onnx/frontend/src/op/topk.cpp @@ -8,16 +8,15 @@ #include "openvino/op/topk.hpp" #include "utils/reshape.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START namespace { /// \return Return the second input to the TopK node reshaped to a scalar. -ov::Output get_k(const ngraph::onnx_import::Node& node) { +ov::Output get_k(const ov::frontend::onnx::Node& node) { auto k_node = node.get_ng_inputs().at(1); FRONT_END_GENERAL_CHECK(shape_size(k_node.get_shape()) == 1, "ONNX TopK operator: 'K' parameter must contain a single positive value.", node); - return ngraph::onnx_import::reshape::interpret_as_scalar(k_node); + return ov::frontend::onnx::reshape::interpret_as_scalar(k_node); } } // namespace @@ -25,11 +24,12 @@ using namespace ov::op; using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector topk(const Node& node) { +ov::OutputVector topk(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); const auto k_node = node.get_attribute_as_constant("k"); const std::int64_t axis{node.get_attribute_value("axis", -1)}; @@ -46,7 +46,7 @@ ov::OutputVector topk(const Node& node) { } // namespace set_1 namespace set_10 { -ov::OutputVector topk(const Node& node) { +ov::OutputVector topk(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); auto k = get_k(node); const std::int64_t axis{node.get_attribute_value("axis", -1)}; @@ -63,7 +63,7 @@ ov::OutputVector topk(const Node& node) { } // namespace set_10 namespace set_11 { -ov::OutputVector topk(const Node& node) { +ov::OutputVector topk(const ov::frontend::onnx::Node& node) { // Process inputs auto data = node.get_ng_inputs().at(0); auto k = get_k(node); @@ -84,10 +84,7 @@ ov::OutputVector topk(const Node& node) { return {top_k->output(0), top_k->output(1)}; } } // namespace set_11 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/topk.hpp b/src/frontends/onnx/frontend/src/op/topk.hpp index 92b1b7f2138a2f..f5968c60c1ac03 100644 --- a/src/frontends/onnx/frontend/src/op/topk.hpp +++ b/src/frontends/onnx/frontend/src/op/topk.hpp @@ -4,13 +4,11 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { /// \brief Performs ONNX TopK operation. @@ -18,7 +16,7 @@ namespace set_1 { /// \param node The ONNX node object representing this operation. /// \return The vector containing OV nodes producing output of ONNX TopK /// operation (both values and indices). -ov::OutputVector topk(const Node& node); +ov::OutputVector topk(const ov::frontend::onnx::Node& node); } // namespace set_1 /// \brief Performs TopK operation from ONNX version 1.5 @@ -26,19 +24,17 @@ ov::OutputVector topk(const Node& node); /// \details ONNX op set 10 added support for K as a dynamic input, not a static /// attribute. namespace set_10 { -ov::OutputVector topk(const Node& node); +ov::OutputVector topk(const ov::frontend::onnx::Node& node); } /// \brief Performs TopK operation from ONNX version 1.6 /// /// \details ONNX op set 11 added support for `largest` and `sorted` attributes. namespace set_11 { -ov::OutputVector topk(const Node& node); +ov::OutputVector topk(const ov::frontend::onnx::Node& node); } } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/transpose.cpp b/src/frontends/onnx/frontend/src/op/transpose.cpp index 511b2251dbcf91..fbf051e7e974bd 100644 --- a/src/frontends/onnx/frontend/src/op/transpose.cpp +++ b/src/frontends/onnx/frontend/src/op/transpose.cpp @@ -8,12 +8,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector transpose(const Node& node) { +ov::OutputVector transpose(const ov::frontend::onnx::Node& node) { ov::Output data = node.get_ng_inputs().at(0); auto permute_axes = node.get_attribute_value>("perm", {}); @@ -22,10 +22,7 @@ ov::OutputVector transpose(const Node& node) { } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/transpose.hpp b/src/frontends/onnx/frontend/src/op/transpose.hpp index 129feb7e87a805..897437d1fda96f 100644 --- a/src/frontends/onnx/frontend/src/op/transpose.hpp +++ b/src/frontends/onnx/frontend/src/op/transpose.hpp @@ -4,22 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector transpose(const Node& node); +ov::OutputVector transpose(const ov::frontend::onnx::Node& node); } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/trilu.cpp b/src/frontends/onnx/frontend/src/op/trilu.cpp index e6111296b6a795..c4207e0f1bb643 100644 --- a/src/frontends/onnx/frontend/src/op/trilu.cpp +++ b/src/frontends/onnx/frontend/src/op/trilu.cpp @@ -20,13 +20,13 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector trilu(const Node& node) { +ov::OutputVector trilu(const ov::frontend::onnx::Node& node) { const auto inputs = node.get_ng_inputs(); const auto num_inputs = inputs.size(); @@ -104,6 +104,6 @@ ov::OutputVector trilu(const Node& node) { } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/trilu.hpp b/src/frontends/onnx/frontend/src/op/trilu.hpp index 72eeb416638a85..abfe0f2522fbea 100644 --- a/src/frontends/onnx/frontend/src/op/trilu.hpp +++ b/src/frontends/onnx/frontend/src/op/trilu.hpp @@ -2,19 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // #pragma once -#include "openvino/core/deprecated.hpp" - -OPENVINO_SUPPRESS_DEPRECATED_START #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector trilu(const Node& node); +ov::OutputVector trilu(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/unique.cpp b/src/frontends/onnx/frontend/src/op/unique.cpp index 58a832a0bdbe1b..d3450e41e697ff 100644 --- a/src/frontends/onnx/frontend/src/op/unique.cpp +++ b/src/frontends/onnx/frontend/src/op/unique.cpp @@ -8,12 +8,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector unique(const Node& node) { +ov::OutputVector unique(const ov::frontend::onnx::Node& node) { const auto data = node.get_ng_inputs().at(0); const bool sorted = node.get_attribute_value("sorted", 1); @@ -26,6 +26,6 @@ ov::OutputVector unique(const Node& node) { } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/unique.hpp b/src/frontends/onnx/frontend/src/op/unique.hpp index 0855fed3f08caf..cc8f181e77e74b 100644 --- a/src/frontends/onnx/frontend/src/op/unique.hpp +++ b/src/frontends/onnx/frontend/src/op/unique.hpp @@ -4,21 +4,17 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector unique(const Node& node); +ov::OutputVector unique(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/unsqueeze.cpp b/src/frontends/onnx/frontend/src/op/unsqueeze.cpp index e2a0cf90d8db65..ad2425527834eb 100644 --- a/src/frontends/onnx/frontend/src/op/unsqueeze.cpp +++ b/src/frontends/onnx/frontend/src/op/unsqueeze.cpp @@ -9,12 +9,12 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector unsqueeze(const Node& node) { +ov::OutputVector unsqueeze(const ov::frontend::onnx::Node& node) { auto data = node.get_ng_inputs().at(0); auto axes_node = node.get_attribute_as_constant>("axes", {}); return {std::make_shared(data, axes_node)}; @@ -23,15 +23,13 @@ ov::OutputVector unsqueeze(const Node& node) { } // namespace set_1 namespace set_13 { -ov::OutputVector unsqueeze(const Node& node) { +ov::OutputVector unsqueeze(const ov::frontend::onnx::Node& node) { auto inputs = node.get_ng_inputs(); return {std::make_shared(inputs.at(0), inputs.at(1))}; } } // namespace set_13 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/unsqueeze.hpp b/src/frontends/onnx/frontend/src/op/unsqueeze.hpp index e1a3a1931d189a..353424b1dc619a 100644 --- a/src/frontends/onnx/frontend/src/op/unsqueeze.hpp +++ b/src/frontends/onnx/frontend/src/op/unsqueeze.hpp @@ -4,26 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector unsqueeze(const Node& node); +ov::OutputVector unsqueeze(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_13 { -ov::OutputVector unsqueeze(const Node& node); +ov::OutputVector unsqueeze(const ov::frontend::onnx::Node& node); } // namespace set_13 } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/upsample.cpp b/src/frontends/onnx/frontend/src/op/upsample.cpp index bced1015bb5748..5a7f69329c2b34 100644 --- a/src/frontends/onnx/frontend/src/op/upsample.cpp +++ b/src/frontends/onnx/frontend/src/op/upsample.cpp @@ -10,16 +10,16 @@ using namespace ov::op; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace { constexpr unsigned version_1{1}; constexpr unsigned version_7{7}; constexpr unsigned version_9{9}; -void check_mode_support(const onnx_import::Node& node, const std::string& mode, const unsigned op_version) { +void check_mode_support(const ov::frontend::onnx::Node& node, const std::string& mode, const unsigned op_version) { const std::unordered_set modes_v1 = {"nearest", "bilinear"}; const std::unordered_set modes_v7 = {"nearest", "linear"}; const auto& supported_modes = op_version < version_7 ? modes_v1 : modes_v7; @@ -55,7 +55,7 @@ v11::Interpolate::InterpolateAttrs get_attributes(const std::string& mode) { } // namespace namespace set_1 { -ov::OutputVector upsample(const onnx_import::Node& node) { +ov::OutputVector upsample(const ov::frontend::onnx::Node& node) { const auto height_scale = node.get_attribute_value("height_scale"); const auto width_scale = node.get_attribute_value("width_scale"); const auto mode = node.get_attribute_value("mode", "nearest"); @@ -81,7 +81,7 @@ ov::OutputVector upsample(const onnx_import::Node& node) { } // namespace set_1 namespace set_7 { -ov::OutputVector upsample(const onnx_import::Node& node) { +ov::OutputVector upsample(const ov::frontend::onnx::Node& node) { const auto scales = node.get_attribute_value>("scales"); const auto mode = node.get_attribute_value("mode", "nearest"); check_mode_support(node, mode, version_7); @@ -102,7 +102,7 @@ ov::OutputVector upsample(const onnx_import::Node& node) { } // namespace set_7 namespace set_9 { -ov::OutputVector upsample(const onnx_import::Node& node) { +ov::OutputVector upsample(const ov::frontend::onnx::Node& node) { const auto mode = node.get_attribute_value("mode", "nearest"); check_mode_support(node, mode, version_9); @@ -112,6 +112,6 @@ ov::OutputVector upsample(const onnx_import::Node& node) { } // namespace set_9 } // namespace op -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/upsample.hpp b/src/frontends/onnx/frontend/src/op/upsample.hpp index 39ab0e8793109c..87d40de79d990d 100644 --- a/src/frontends/onnx/frontend/src/op/upsample.hpp +++ b/src/frontends/onnx/frontend/src/op/upsample.hpp @@ -4,32 +4,27 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector upsample(const Node& node); +ov::OutputVector upsample(const ov::frontend::onnx::Node& node); } // namespace set_1 namespace set_7 { -ov::OutputVector upsample(const Node& node); +ov::OutputVector upsample(const ov::frontend::onnx::Node& node); } // namespace set_7 namespace set_9 { -ov::OutputVector upsample(const Node& node); +ov::OutputVector upsample(const ov::frontend::onnx::Node& node); } // namespace set_9 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/where.hpp b/src/frontends/onnx/frontend/src/op/where.hpp index 8983398c31ccd4..f867f7ed54266b 100644 --- a/src/frontends/onnx/frontend/src/op/where.hpp +++ b/src/frontends/onnx/frontend/src/op/where.hpp @@ -4,26 +4,21 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/select.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector where(const Node& node) { +inline ov::OutputVector where(const ov::frontend::onnx::Node& node) { ov::OutputVector ng_inputs{node.get_ng_inputs()}; return {std::make_shared(ng_inputs.at(0), ng_inputs.at(1), ng_inputs.at(2))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/op/xor.hpp b/src/frontends/onnx/frontend/src/op/xor.hpp index db794b887bbb83..36fc06b7a38cc8 100644 --- a/src/frontends/onnx/frontend/src/op/xor.hpp +++ b/src/frontends/onnx/frontend/src/op/xor.hpp @@ -4,27 +4,22 @@ #pragma once -#include "openvino/core/deprecated.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START - #include "core/node.hpp" #include "openvino/op/logical_xor.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -inline ov::OutputVector logical_xor(const Node& node) { +inline ov::OutputVector logical_xor(const ov::frontend::onnx::Node& node) { return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1), ov::op::AutoBroadcastSpec(ov::op::AutoBroadcastType::NUMPY))}; } } // namespace set_1 - } // namespace op - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/ops_bridge.cpp b/src/frontends/onnx/frontend/src/ops_bridge.cpp index 7d45d51bfe1fee..334eae33837371 100644 --- a/src/frontends/onnx/frontend/src/ops_bridge.cpp +++ b/src/frontends/onnx/frontend/src/ops_bridge.cpp @@ -193,8 +193,9 @@ using namespace ov::frontend::onnx; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { const char* OPENVINO_ONNX_DOMAIN = "org.openvinotoolkit"; @@ -606,6 +607,6 @@ OperatorsBridge::OperatorsBridge() { #undef REGISTER_OPERATOR #undef REGISTER_OPERATOR_WITH_DOMAIN -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/ops_bridge.hpp b/src/frontends/onnx/frontend/src/ops_bridge.hpp index fa611a1c2e8c79..7f0fe96785bd03 100644 --- a/src/frontends/onnx/frontend/src/ops_bridge.hpp +++ b/src/frontends/onnx/frontend/src/ops_bridge.hpp @@ -12,11 +12,11 @@ #include #include "core/operator_set.hpp" -#include "openvino/core/deprecated.hpp" #include "version_range.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { class OperatorsBridge { public: @@ -89,6 +89,6 @@ class OperatorsBridge { extern const char* OPENVINO_ONNX_DOMAIN; -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/place.cpp b/src/frontends/onnx/frontend/src/place.cpp index 3430bf4e6b56cb..f08221d3d3cbff 100644 --- a/src/frontends/onnx/frontend/src/place.cpp +++ b/src/frontends/onnx/frontend/src/place.cpp @@ -9,12 +9,12 @@ using namespace ov; using namespace ov::frontend::onnx; -PlaceInputEdge::PlaceInputEdge(const onnx_editor::InputEdge& edge, std::shared_ptr editor) +PlaceInputEdge::PlaceInputEdge(const InputEdge& edge, std::shared_ptr editor) : m_edge{edge}, m_editor{std::move(editor)}, m_initial_source_tensor_name{m_editor->get_source_tensor_name(m_edge)} {} -PlaceInputEdge::PlaceInputEdge(onnx_editor::InputEdge&& edge, std::shared_ptr editor) +PlaceInputEdge::PlaceInputEdge(InputEdge&& edge, std::shared_ptr editor) : m_edge{std::move(edge)}, m_editor{std::move(editor)}, m_initial_source_tensor_name{m_editor->get_source_tensor_name(m_edge)} {} @@ -26,7 +26,7 @@ void PlaceInputEdge::check_if_valid() const { " is outdated since the topology of the model has been changed."); } -onnx_editor::InputEdge PlaceInputEdge::get_input_edge() const { +InputEdge PlaceInputEdge::get_input_edge() const { return m_edge; } @@ -65,7 +65,7 @@ ov::frontend::Place::Ptr PlaceInputEdge::get_source_tensor() const { std::vector PlaceInputEdge::get_consuming_operations() const { check_if_valid(); - return {std::make_shared(onnx_editor::EditorNode{m_edge.m_node_idx}, m_editor)}; + return {std::make_shared(EditorNode{m_edge.m_node_idx}, m_editor)}; } ov::frontend::Place::Ptr PlaceInputEdge::get_producing_operation() const { @@ -76,13 +76,12 @@ ov::frontend::Place::Ptr PlaceInputEdge::get_producing_port() const { return get_source_tensor()->get_producing_port(); } -PlaceOutputEdge::PlaceOutputEdge(const onnx_editor::OutputEdge& edge, - std::shared_ptr editor) +PlaceOutputEdge::PlaceOutputEdge(const OutputEdge& edge, std::shared_ptr editor) : m_edge{edge}, m_editor{std::move(editor)}, m_initial_target_tensor_name{m_editor->get_target_tensor_name(edge)} {} -PlaceOutputEdge::PlaceOutputEdge(onnx_editor::OutputEdge&& edge, std::shared_ptr editor) +PlaceOutputEdge::PlaceOutputEdge(OutputEdge&& edge, std::shared_ptr editor) : m_edge{std::move(edge)}, m_editor{std::move(editor)}, m_initial_target_tensor_name{m_editor->get_target_tensor_name(m_edge)} {} @@ -95,7 +94,7 @@ void PlaceOutputEdge::check_if_valid() const { " is outdated since the topology of the model has been changed."); } -onnx_editor::OutputEdge PlaceOutputEdge::get_output_edge() const { +OutputEdge PlaceOutputEdge::get_output_edge() const { return m_edge; } @@ -138,18 +137,18 @@ std::vector PlaceOutputEdge::get_consuming_ports() con ov::frontend::Place::Ptr PlaceOutputEdge::get_producing_operation() const { check_if_valid(); - return std::make_shared(onnx_editor::EditorNode{m_edge.m_node_idx}, m_editor); + return std::make_shared(EditorNode{m_edge.m_node_idx}, m_editor); } std::vector PlaceOutputEdge::get_consuming_operations() const { return get_target_tensor()->get_consuming_operations(); } -PlaceTensor::PlaceTensor(const std::string& name, std::shared_ptr editor) +PlaceTensor::PlaceTensor(const std::string& name, std::shared_ptr editor) : m_name{name}, m_editor{std::move(editor)} {} -PlaceTensor::PlaceTensor(std::string&& name, std::shared_ptr editor) +PlaceTensor::PlaceTensor(std::string&& name, std::shared_ptr editor) : m_name{std::move(name)}, m_editor{std::move(editor)} {} @@ -166,7 +165,7 @@ ov::frontend::Place::Ptr PlaceTensor::get_producing_port() const { std::vector PlaceTensor::get_consuming_ports() const { std::vector ret; auto edges = m_editor->find_output_consumers(m_name); - std::transform(edges.begin(), edges.end(), std::back_inserter(ret), [this](const onnx_editor::InputEdge& edge) { + std::transform(edges.begin(), edges.end(), std::back_inserter(ret), [this](const InputEdge& edge) { return std::make_shared(edge, this->m_editor); }); return ret; @@ -228,12 +227,12 @@ void PlaceTensor::set_name_for_dimension(size_t shape_dim_index, const std::stri m_editor->set_name_for_dimension(m_name, shape_dim_index, dim_name); } -PlaceOp::PlaceOp(const onnx_editor::EditorNode& node, std::shared_ptr editor) +PlaceOp::PlaceOp(const EditorNode& node, std::shared_ptr editor) : m_node{node}, m_editor{std::move(editor)}, m_initial_first_output{m_editor->get_output_ports(m_node).at(0)} {} -PlaceOp::PlaceOp(onnx_editor::EditorNode&& node, std::shared_ptr editor) +PlaceOp::PlaceOp(EditorNode&& node, std::shared_ptr editor) : m_node{std::move(node)}, m_editor{std::move(editor)}, m_initial_first_output{m_editor->get_output_ports(m_node).at(0)} {} @@ -254,7 +253,7 @@ std::vector PlaceOp::get_names() const { } } -const onnx_editor::EditorNode& PlaceOp::get_editor_node() const { +const EditorNode& PlaceOp::get_editor_node() const { return m_node; } @@ -269,9 +268,8 @@ ov::frontend::Place::Ptr PlaceOp::get_output_port(int output_port_index) const { check_if_valid(); const int out_ports_number = static_cast(m_editor->get_output_ports(m_node).size()); if (output_port_index < out_ports_number) { - return std::make_shared( - m_editor->find_output_edge(m_node, onnx_editor::EditorOutput{output_port_index}), - m_editor); + return std::make_shared(m_editor->find_output_edge(m_node, EditorOutput{output_port_index}), + m_editor); } return nullptr; } @@ -280,9 +278,8 @@ ov::frontend::Place::Ptr PlaceOp::get_output_port(const std::string& output_port check_if_valid(); const auto output_ports = m_editor->get_output_ports(m_node); if (std::count(std::begin(output_ports), std::end(output_ports), output_port_name) == 1) { - return std::make_shared( - m_editor->find_output_edge(m_node, onnx_editor::EditorOutput{output_port_name}), - m_editor); + return std::make_shared(m_editor->find_output_edge(m_node, EditorOutput{output_port_name}), + m_editor); } return nullptr; } @@ -298,9 +295,8 @@ ov::frontend::Place::Ptr PlaceOp::get_input_port(int input_port_index) const { check_if_valid(); const int in_ports_number = static_cast(m_editor->get_input_ports(m_node).size()); if (input_port_index < in_ports_number) { - return std::make_shared( - m_editor->find_input_edge(m_node, onnx_editor::EditorInput{input_port_index}), - m_editor); + return std::make_shared(m_editor->find_input_edge(m_node, EditorInput{input_port_index}), + m_editor); } return nullptr; } @@ -309,8 +305,7 @@ ov::frontend::Place::Ptr PlaceOp::get_input_port(const std::string& input_name) check_if_valid(); const auto input_ports = m_editor->get_input_ports(m_node); if (std::count(std::begin(input_ports), std::end(input_ports), input_name) == 1) { - return std::make_shared(m_editor->find_input_edge(m_node, onnx_editor::EditorInput{input_name}), - m_editor); + return std::make_shared(m_editor->find_input_edge(m_node, EditorInput{input_name}), m_editor); } return nullptr; } diff --git a/src/frontends/onnx/frontend/src/place.hpp b/src/frontends/onnx/frontend/src/place.hpp index 8e70b4db8ce16f..0a3d95855e98a7 100644 --- a/src/frontends/onnx/frontend/src/place.hpp +++ b/src/frontends/onnx/frontend/src/place.hpp @@ -15,11 +15,11 @@ namespace onnx { class PlaceInputEdge : public Place { public: - PlaceInputEdge(const onnx_editor::InputEdge& edge, std::shared_ptr editor); - PlaceInputEdge(onnx_editor::InputEdge&& edge, std::shared_ptr editor); + PlaceInputEdge(const InputEdge& edge, std::shared_ptr editor); + PlaceInputEdge(InputEdge&& edge, std::shared_ptr editor); // internal usage - onnx_editor::InputEdge get_input_edge() const; + InputEdge get_input_edge() const; void check_if_valid() const; // external usage @@ -34,18 +34,18 @@ class PlaceInputEdge : public Place { Place::Ptr get_producing_port() const override; private: - onnx_editor::InputEdge m_edge; - const std::shared_ptr m_editor; + InputEdge m_edge; + const std::shared_ptr m_editor; std::string m_initial_source_tensor_name; }; class PlaceOutputEdge : public Place { public: - PlaceOutputEdge(const onnx_editor::OutputEdge& edge, std::shared_ptr editor); - PlaceOutputEdge(onnx_editor::OutputEdge&& edge, std::shared_ptr editor); + PlaceOutputEdge(const OutputEdge& edge, std::shared_ptr editor); + PlaceOutputEdge(OutputEdge&& edge, std::shared_ptr editor); // internal usage - onnx_editor::OutputEdge get_output_edge() const; + OutputEdge get_output_edge() const; void check_if_valid() const; // external usage @@ -60,15 +60,15 @@ class PlaceOutputEdge : public Place { std::vector get_consuming_operations() const override; private: - onnx_editor::OutputEdge m_edge; - std::shared_ptr m_editor; + OutputEdge m_edge; + std::shared_ptr m_editor; std::string m_initial_target_tensor_name; }; class PlaceTensor : public Place { public: - PlaceTensor(const std::string& name, std::shared_ptr editor); - PlaceTensor(std::string&& name, std::shared_ptr editor); + PlaceTensor(const std::string& name, std::shared_ptr editor); + PlaceTensor(std::string&& name, std::shared_ptr editor); // external usage std::vector get_names() const override; @@ -86,17 +86,17 @@ class PlaceTensor : public Place { private: std::string m_name; - std::shared_ptr m_editor; + std::shared_ptr m_editor; }; class PlaceOp : public Place { public: - PlaceOp(const onnx_editor::EditorNode& node, std::shared_ptr editor); - PlaceOp(onnx_editor::EditorNode&& node, std::shared_ptr editor); + PlaceOp(const EditorNode& node, std::shared_ptr editor); + PlaceOp(EditorNode&& node, std::shared_ptr editor); std::vector get_names() const override; // internal usage - const onnx_editor::EditorNode& get_editor_node() const; + const EditorNode& get_editor_node() const; void set_name(const std::string& new_name); void check_if_valid() const; @@ -131,8 +131,8 @@ class PlaceOp : public Place { bool is_output() const override; private: - onnx_editor::EditorNode m_node; - std::shared_ptr m_editor; + EditorNode m_node; + std::shared_ptr m_editor; std::string m_initial_first_output; }; diff --git a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp index 05633b47116ad0..0bbcf2dcc22af4 100644 --- a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp @@ -17,16 +17,16 @@ using namespace ov; using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace utils { -OPENVINO_SUPPRESS_DEPRECATED_START + ArgMinMaxFactory::ArgMinMaxFactory(const Node& node) : m_keep_dims{node.get_attribute_value("keepdims", 1)}, m_input_node{node.get_ng_inputs().at(0)}, m_axis{node.get_attribute_value("axis", 0)}, m_select_last_index{node.get_attribute_value("select_last_index", 0)} {} -OPENVINO_SUPPRESS_DEPRECATED_END std::shared_ptr ArgMinMaxFactory::make_arg_max() const { return make_topk_subgraph(v11::TopK::Mode::MAX); @@ -106,5 +106,6 @@ std::shared_ptr ArgMinMaxFactory::make_topk_subgraph(v11::TopK::Mode m return result; } } // namespace utils -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.hpp b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.hpp index 943655e56d66d4..213aee65fb23e5 100644 --- a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.hpp +++ b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.hpp @@ -8,19 +8,18 @@ #include #include "core/node.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" #include "openvino/op/topk.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace utils { /// \brief Factory class which generates sub-graphs for ONNX ArgMin, ArgMax ops. class ArgMinMaxFactory { public: - OPENVINO_SUPPRESS_DEPRECATED_START explicit ArgMinMaxFactory(const Node& node); - OPENVINO_SUPPRESS_DEPRECATED_END + virtual ~ArgMinMaxFactory() = default; /// \brief Creates ArgMax ONNX operation. @@ -41,5 +40,6 @@ class ArgMinMaxFactory { }; } // namespace utils -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/common.cpp b/src/frontends/onnx/frontend/src/utils/common.cpp index 21626b31929f3f..a9e9395bedebf4 100644 --- a/src/frontends/onnx/frontend/src/utils/common.cpp +++ b/src/frontends/onnx/frontend/src/utils/common.cpp @@ -7,7 +7,6 @@ #include // onnx types #include "onnx_framework_node.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/frontend/exception.hpp" #include "openvino/op/add.hpp" #include "openvino/op/broadcast.hpp" @@ -21,41 +20,42 @@ #include "openvino/op/subtract.hpp" using namespace ov::op; +using ::ONNX_NAMESPACE::TensorProto_DataType; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace common { const ov::element::Type& get_ov_element_type(int64_t onnx_type) { switch (onnx_type) { - case ONNX_NAMESPACE::TensorProto_DataType_BOOL: + case TensorProto_DataType::TensorProto_DataType_BOOL: return ov::element::boolean; - case ONNX_NAMESPACE::TensorProto_DataType_DOUBLE: + case TensorProto_DataType::TensorProto_DataType_DOUBLE: return ov::element::f64; - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT16: + case TensorProto_DataType::TensorProto_DataType_FLOAT16: return ov::element::f16; - case ONNX_NAMESPACE::TensorProto_DataType_FLOAT: + case TensorProto_DataType::TensorProto_DataType_FLOAT: return ov::element::f32; - case ONNX_NAMESPACE::TensorProto_DataType_INT8: + case TensorProto_DataType::TensorProto_DataType_INT8: return ov::element::i8; - case ONNX_NAMESPACE::TensorProto_DataType_INT16: + case TensorProto_DataType::TensorProto_DataType_INT16: return ov::element::i16; - case ONNX_NAMESPACE::TensorProto_DataType_INT32: + case TensorProto_DataType::TensorProto_DataType_INT32: return ov::element::i32; - case ONNX_NAMESPACE::TensorProto_DataType_INT64: + case TensorProto_DataType::TensorProto_DataType_INT64: return ov::element::i64; - case ONNX_NAMESPACE::TensorProto_DataType_UINT8: + case TensorProto_DataType::TensorProto_DataType_UINT8: return ov::element::u8; - case ONNX_NAMESPACE::TensorProto_DataType_UINT16: + case TensorProto_DataType::TensorProto_DataType_UINT16: return ov::element::u16; - case ONNX_NAMESPACE::TensorProto_DataType_UINT32: + case TensorProto_DataType::TensorProto_DataType_UINT32: return ov::element::u32; - case ONNX_NAMESPACE::TensorProto_DataType_UINT64: + case TensorProto_DataType::TensorProto_DataType_UINT64: return ov::element::u64; - case ONNX_NAMESPACE::TensorProto_DataType_UNDEFINED: + case TensorProto_DataType::TensorProto_DataType_UNDEFINED: return ov::element::dynamic; - case ONNX_NAMESPACE::TensorProto_DataType_BFLOAT16: + case TensorProto_DataType::TensorProto_DataType_BFLOAT16: return ov::element::bf16; } OPENVINO_THROW("unsupported element type"); @@ -99,7 +99,7 @@ void validate_scalar_input(const char* input_name, } template -ov::OutputVector handle_opset6_binary_op(const Node& node) { +ov::OutputVector handle_opset6_binary_op(const ov::frontend::onnx::Node& node) { const ov::Output lhs_node = node.get_ng_inputs().at(0); ov::Output rhs_node = node.get_ng_inputs().at(1); const bool broadcast = node.get_attribute_value("broadcast", 0); @@ -167,7 +167,7 @@ std::string collect_translation_exceptions(const std::shared_ptr& par bool unsupported_found = false; bool additional_error_found = false; for (const auto& op : partially_converted->get_ops()) { - if (const auto unsupported = std::dynamic_pointer_cast(op)) { + if (const auto unsupported = std::dynamic_pointer_cast(op)) { if (unsupported->additional_error_message().empty()) { fully_unsupported_ops += (unsupported->get_attrs().get_opset_name().empty() ? "" @@ -198,6 +198,6 @@ std::string collect_translation_exceptions(const std::shared_ptr& par } } // namespace common -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/common.hpp b/src/frontends/onnx/frontend/src/utils/common.hpp index 801901c5dd0037..0bfee5c8dce3a5 100644 --- a/src/frontends/onnx/frontend/src/utils/common.hpp +++ b/src/frontends/onnx/frontend/src/utils/common.hpp @@ -14,14 +14,14 @@ #include #include "core/node.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" #include "openvino/core/shape.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/op/constant.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace common { const ov::element::Type& get_ov_element_type(std::int64_t onnx_type); @@ -131,10 +131,9 @@ std::unique_ptr make_unique(Args&&... args) { /// \param node ONNX node /// /// \return ov::OutputVector with binary op -OPENVINO_SUPPRESS_DEPRECATED_START + template -ov::OutputVector handle_opset6_binary_op(const Node& node); -OPENVINO_SUPPRESS_DEPRECATED_END +ov::OutputVector handle_opset6_binary_op(const ov::frontend::onnx::Node& node); /// \brief Creates a "dummy" constant to be used in place of an invalid initializer /// encountered in the original model. @@ -157,5 +156,6 @@ bool is_optimized_out(const ov::Output& node_output); /// \brief Collect unsupported operators after convert_partially and all exceptions from translation process. std::string collect_translation_exceptions(const std::shared_ptr& partially_converted); } // namespace common -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/conv_factory.cpp b/src/frontends/onnx/frontend/src/utils/conv_factory.cpp index 37622708ba586d..782924439a7e05 100644 --- a/src/frontends/onnx/frontend/src/utils/conv_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/conv_factory.cpp @@ -12,8 +12,9 @@ #include "utils/convpool.hpp" #include "utils/reshape.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace conv_factory { std::shared_ptr make_ng_convolution(const ov::Output& data, const ov::Output& filters, @@ -44,5 +45,6 @@ std::shared_ptr make_ng_convolution(const ov::Output& data } } } // namespace conv_factory -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/conv_factory.hpp b/src/frontends/onnx/frontend/src/utils/conv_factory.hpp index 681cb92787f784..bf3020d4256f1b 100644 --- a/src/frontends/onnx/frontend/src/utils/conv_factory.hpp +++ b/src/frontends/onnx/frontend/src/utils/conv_factory.hpp @@ -8,8 +8,9 @@ #include "openvino/core/node.hpp" #include "openvino/op/op.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace conv_factory { std::shared_ptr make_ng_convolution(const ov::Output& data, const ov::Output& filters, @@ -20,5 +21,6 @@ std::shared_ptr make_ng_convolution(const ov::Output& data int64_t groups, const ov::op::PadType& auto_pad); } // namespace conv_factory -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/convpool.cpp b/src/frontends/onnx/frontend/src/utils/convpool.cpp index 37939c225dadd8..0458e783ebe2c8 100644 --- a/src/frontends/onnx/frontend/src/utils/convpool.cpp +++ b/src/frontends/onnx/frontend/src/utils/convpool.cpp @@ -19,10 +19,9 @@ using namespace ov; using namespace ov::op; using ov::CoordinateDiff; -OPENVINO_SUPPRESS_DEPRECATED_START - -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace convpool { ov::Shape get_kernel_shape(const Node& node) { const auto& data_shape = node.get_ng_inputs().at(0).get_partial_shape(); @@ -181,7 +180,6 @@ Output get_reshaped_filters(const Output& filters, int64_t g return reshaped_filters; } } // namespace convpool -} // namespace onnx_import -} // namespace ngraph - -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/convpool.hpp b/src/frontends/onnx/frontend/src/utils/convpool.hpp index 3e47f769a3439f..052e63e7d15993 100644 --- a/src/frontends/onnx/frontend/src/utils/convpool.hpp +++ b/src/frontends/onnx/frontend/src/utils/convpool.hpp @@ -5,19 +5,18 @@ #pragma once #include "core/node.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/shape.hpp" #include "openvino/core/strides.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace convpool { /// \brief Get shape of kernel (filter) in pixels. /// /// \param node The Node ptr representing Conv or Pool operation. /// \return The kernel Shape object representing its dimensions (height, width, depth). -ov::Shape get_kernel_shape(const Node& node); +ov::Shape get_kernel_shape(const ov::frontend::onnx::Node& node); /// /// \brief Get number of pixels to stride operation by in each direction. @@ -27,7 +26,7 @@ ov::Shape get_kernel_shape(const Node& node); /// /// \return The kernel Shape object representing its dimensions (height, width, /// depth). -ov::Strides get_strides(const Node& node, const std::size_t kernel_rank = 0UL); +ov::Strides get_strides(const ov::frontend::onnx::Node& node, const std::size_t kernel_rank = 0UL); /// /// \brief Get number of pixels for filter dilation in each direction. @@ -37,14 +36,14 @@ ov::Strides get_strides(const Node& node, const std::size_t kernel_rank = 0UL); /// /// \return The ov::Strides object containing number of pixels for filter dilation /// (height, width, depth). -ov::Strides get_dilations(const Node& node, const std::size_t kernel_rank = 0UL); +ov::Strides get_dilations(const ov::frontend::onnx::Node& node, const std::size_t kernel_rank = 0UL); /// \brief Gets the 'ceil_mode' (rounding type) attribute value. /// /// \param[in] node The ONNX node we query for attribute. /// /// \return The OV RoundingType object representing 'ceil_mode' attribute value. -ov::op::RoundingType get_rounding_type(const Node& node); +ov::op::RoundingType get_rounding_type(const ov::frontend::onnx::Node& node); /// \brief Get padding values for the operation described by an ONNX node. /// \details Values are taken from the `pads` attribute. @@ -56,7 +55,8 @@ ov::op::RoundingType get_rounding_type(const Node& node); /// /// \return A pair of (padding_above, padding_below), which elements contains number of /// pixels to pad in respective dimensions (height, width, depth). -std::pair get_pads(const Node& node, const size_t kernel_rank); +std::pair get_pads(const ov::frontend::onnx::Node& node, + const size_t kernel_rank); /// \brief Get padding values for the operation described by an ONNX node. /// \details Values are taken from the `pads` attribute. @@ -67,7 +67,7 @@ std::pair get_pads(const Node& node, con /// /// \return A pair of (padding_above, padding_below), which elements contains number of /// pixels to pad in respective dimensions (height, width, depth). -std::pair get_pads(const Node& node); +std::pair get_pads(const ov::frontend::onnx::Node& node); /// /// \brief Calculate paddings with respect to auto_pad value. @@ -95,7 +95,7 @@ void calculate_auto_pads(const ov::Shape& data_shape, /// /// \return The OV PadType object representing 'auto_pad' attribute value. /// -ov::op::PadType get_auto_pad(const Node& node); +ov::op::PadType get_auto_pad(const ov::frontend::onnx::Node& node); /// \brief Reshape group convolution filters to match desired shape: /// from [C_INPUT x C_OUTPUT/groups x k1 x k2 x ... x kn] @@ -107,8 +107,6 @@ ov::op::PadType get_auto_pad(const Node& node); /// \return Reshaped filters input. ov::Output get_reshaped_filters(const ov::Output& filters, int64_t groups); } // namespace convpool - -} // namespace onnx_import - -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/dft.cpp b/src/frontends/onnx/frontend/src/utils/dft.cpp index 38a75a57f51d1b..4b9702f54ba0b4 100644 --- a/src/frontends/onnx/frontend/src/utils/dft.cpp +++ b/src/frontends/onnx/frontend/src/utils/dft.cpp @@ -5,7 +5,6 @@ #include "dft.hpp" #include "core/null_node.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" @@ -18,8 +17,9 @@ using namespace ov::op; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace dft { namespace { @@ -54,9 +54,8 @@ ov::Output make_dft(const ov::Output& signal, if (is_inversed || !is_onesided) { // skip for RDFT case conversion_to_complex_applied = try_convert_real_to_complex(processed_signal); } - OPENVINO_SUPPRESS_DEPRECATED_START + bool dft_length_provided = !ov::op::util::is_null(length); - OPENVINO_SUPPRESS_DEPRECATED_END ov::Output result; if (is_inversed) { @@ -83,5 +82,6 @@ ov::Output make_dft(const ov::Output& signal, return {result}; } } // namespace dft -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/dft.hpp b/src/frontends/onnx/frontend/src/utils/dft.hpp index 6ab0b01580df43..4052b250635e6d 100644 --- a/src/frontends/onnx/frontend/src/utils/dft.hpp +++ b/src/frontends/onnx/frontend/src/utils/dft.hpp @@ -6,8 +6,9 @@ #include "openvino/core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace dft { ov::Output make_dft(const ov::Output& signal, @@ -16,5 +17,6 @@ ov::Output make_dft(const ov::Output& signal, bool is_inversed, bool is_one_sided); } // namespace dft -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/onnx_internal.cpp b/src/frontends/onnx/frontend/src/utils/onnx_internal.cpp index fd7ec5d34cf1d7..11c55e2251b7d6 100644 --- a/src/frontends/onnx/frontend/src/utils/onnx_internal.cpp +++ b/src/frontends/onnx/frontend/src/utils/onnx_internal.cpp @@ -15,8 +15,9 @@ using namespace ov; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace detail { namespace { void remove_dangling_parameters(std::shared_ptr& model) { @@ -30,7 +31,7 @@ void remove_dangling_parameters(std::shared_ptr& model) { std::all_of(parameter_users.begin(), parameter_users.end(), [](const std::shared_ptr& node) -> bool { - return std::dynamic_pointer_cast(node) != nullptr; + return std::dynamic_pointer_cast(node) != nullptr; }); if (is_dangling_parameter) { model->remove_parameter(parameter); @@ -46,9 +47,7 @@ void remove_dangling_results(std::shared_ptr& model) { const auto result_inputs = result->input_values(); const bool is_dangling_result = std::all_of(result_inputs.begin(), result_inputs.end(), [](const Output& node) -> bool { - OPENVINO_SUPPRESS_DEPRECATED_START return ov::op::util::is_null(node); - OPENVINO_SUPPRESS_DEPRECATED_END }); if (is_dangling_result) { model->remove_result(result); @@ -56,7 +55,7 @@ void remove_dangling_results(std::shared_ptr& model) { } } -void apply_transformations(ONNX_NAMESPACE::ModelProto& model_proto) { +void apply_transformations(ModelProto& model_proto) { transform::fixup_legacy_operators(model_proto); } @@ -68,10 +67,10 @@ void convert_decoded_model(std::shared_ptr model) { OPENVINO_ASSERT(it != rt_info.end(), "Could not find '" + std::string(ONNX_GRAPH_RT_ATTRIBUTE) + "' attribute in decoded model. Model probably wasn't created by FrontEnd::decode function."); - auto onnx_graph = it->second.as>(); + auto onnx_graph = it->second.as>(); for (const auto& node : model->get_ordered_ops()) { - if (auto raw_node = std::dynamic_pointer_cast(node)) { - if (auto subgraph_node = std::dynamic_pointer_cast(node)) { + if (auto raw_node = std::dynamic_pointer_cast(node)) { + if (auto subgraph_node = std::dynamic_pointer_cast(node)) { subgraph_node->infer_inputs_from_parent(); for (auto& model : subgraph_node->get_subgraph_models()) { convert_decoded_model(model); @@ -90,7 +89,7 @@ void convert_decoded_model(std::shared_ptr model) { detail::remove_dangling_results(model); } -std::shared_ptr import_onnx_model(std::shared_ptr model_proto, +std::shared_ptr import_onnx_model(std::shared_ptr model_proto, const std::string& model_path, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions) { @@ -102,7 +101,7 @@ std::shared_ptr import_onnx_model(std::shared_ptr decode_to_framework_nodes(std::shared_ptr model_proto, +std::shared_ptr decode_to_framework_nodes(std::shared_ptr model_proto, const std::string& model_path, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions) { @@ -114,5 +113,6 @@ std::shared_ptr decode_to_framework_nodes(std::shared_ptrdecode(); } } // namespace detail -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/onnx_internal.hpp b/src/frontends/onnx/frontend/src/utils/onnx_internal.hpp index c66c3eab852197..e6afa4b582cecc 100644 --- a/src/frontends/onnx/frontend/src/utils/onnx_internal.hpp +++ b/src/frontends/onnx/frontend/src/utils/onnx_internal.hpp @@ -15,9 +15,13 @@ namespace ONNX_NAMESPACE { class ModelProto; } -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace detail { + +using ::ONNX_NAMESPACE::ModelProto; + /// \brief Imports and converts an serialized ONNX model from a ModelProto /// to an ov::Model representation. /// @@ -33,7 +37,7 @@ namespace detail { /// \param extensions An object containing a collection of frontend extensions to use during the import process /// \return An ov::Model that represents a single output from the created /// graph. -std::shared_ptr import_onnx_model(std::shared_ptr model_proto, +std::shared_ptr import_onnx_model(std::shared_ptr model_proto, const std::string& model_path, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions = {}); @@ -46,7 +50,7 @@ std::shared_ptr import_onnx_model(std::shared_ptr decode_to_framework_nodes(std::shared_ptr model_proto, +std::shared_ptr decode_to_framework_nodes(std::shared_ptr model_proto, const std::string& model_path, detail::MappedMemoryHandles mmap_cache, ov::frontend::ExtensionHolder extensions = {}); @@ -56,5 +60,6 @@ std::shared_ptr decode_to_framework_nodes(std::shared_ptr model); } // namespace detail -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp index 95e6d951455633..13eeedd65c787a 100644 --- a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp @@ -17,8 +17,9 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace pooling { namespace { @@ -36,7 +37,6 @@ std::shared_ptr transposition_axis_order(const ov::Rank& input_ran } } // namespace -OPENVINO_SUPPRESS_DEPRECATED_START PoolingFactory::PoolingFactory(const Node& node) : m_onnx_node{node}, m_inputs{node.get_ng_inputs()}, @@ -64,7 +64,6 @@ ov::OutputVector PoolingFactory::make_avg_pool() const { m_rounding_type, m_auto_pad)}; } -OPENVINO_SUPPRESS_DEPRECATED_END ov::OutputVector PoolingFactory::make_max_pool() const { return {std::make_shared(m_inputs.at(0), @@ -95,5 +94,6 @@ ov::OutputVector PoolingFactory::make_max_pool_with_indices() const { } } } // namespace pooling -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp b/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp index 5c09c6e92ccfd8..452af29e6c159e 100644 --- a/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp +++ b/src/frontends/onnx/frontend/src/utils/pooling_factory.hpp @@ -8,15 +8,15 @@ #include #include "core/node.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" #include "openvino/core/shape.hpp" #include "openvino/core/strides.hpp" #include "openvino/op/op.hpp" #include "openvino/op/util/attr_types.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace pooling { /// /// \brief Factory class which generates sub-graphs for ONNX 'regular' pooling @@ -30,10 +30,8 @@ namespace pooling { /// paddings, kernel shape and auto_pad type. class PoolingFactory { public: - OPENVINO_SUPPRESS_DEPRECATED_START explicit PoolingFactory(const Node& node); virtual ~PoolingFactory() = default; - OPENVINO_SUPPRESS_DEPRECATED_END /// /// \brief Creates average pooling ONNX operation. @@ -51,9 +49,8 @@ class PoolingFactory { ov::OutputVector make_max_pool_with_indices() const; protected: - OPENVINO_SUPPRESS_DEPRECATED_START Node m_onnx_node; - OPENVINO_SUPPRESS_DEPRECATED_END + const ov::OutputVector m_inputs; ov::Shape m_kernel_shape; ov::Strides m_strides; @@ -68,5 +65,6 @@ class PoolingFactory { StorageOrder m_storage_order; }; } // namespace pooling -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/recurrent.cpp b/src/frontends/onnx/frontend/src/utils/recurrent.cpp index 043a2e4a6c521e..0f1f6f1690c0a7 100644 --- a/src/frontends/onnx/frontend/src/utils/recurrent.cpp +++ b/src/frontends/onnx/frontend/src/utils/recurrent.cpp @@ -24,11 +24,11 @@ using namespace ov::op; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace recurrent { -OpInputMap::OpInputMap(const onnx_import::Node& node, std::size_t gates_count) { +OpInputMap::OpInputMap(const ov::frontend::onnx::Node& node, std::size_t gates_count) { const auto& ng_inputs = node.get_ng_inputs(); m_map[OpInput::X] = ov::op::util::reorder_axes(ng_inputs.at(0), {1, 0, 2}); @@ -115,6 +115,6 @@ OpAttributes::OpAttributes(const Node& node) } } // namespace recurrent -} // namespace onnx_import -} // namespace ngraph -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/recurrent.hpp b/src/frontends/onnx/frontend/src/utils/recurrent.hpp index b286510edb24e4..a40a75a7e5100d 100644 --- a/src/frontends/onnx/frontend/src/utils/recurrent.hpp +++ b/src/frontends/onnx/frontend/src/utils/recurrent.hpp @@ -9,12 +9,12 @@ #include #include "core/node.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" #include "openvino/op/util/attr_types.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace recurrent { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INPUT NODES PARSING ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -41,9 +41,8 @@ enum class OpInput { struct OpInputMap { using container_type = std::map>; - OPENVINO_SUPPRESS_DEPRECATED_START - explicit OpInputMap(const onnx_import::Node& node, std::size_t gates_count); - OPENVINO_SUPPRESS_DEPRECATED_END + explicit OpInputMap(const ov::frontend::onnx::Node& node, std::size_t gates_count); + OpInputMap(container_type&& map); virtual ~OpInputMap() = default; @@ -59,9 +58,8 @@ struct OpInputMap { /// \brief This structure aggregates operator's attributes. /// struct OpAttributes { - OPENVINO_SUPPRESS_DEPRECATED_START explicit OpAttributes(const Node& node); - OPENVINO_SUPPRESS_DEPRECATED_END + virtual ~OpAttributes() = default; ov::op::RecurrentSequenceDirection m_direction; @@ -73,5 +71,6 @@ struct OpAttributes { }; } // namespace recurrent -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/reshape.cpp b/src/frontends/onnx/frontend/src/utils/reshape.cpp index a3e3873fbd070c..35c8efbbf941c5 100644 --- a/src/frontends/onnx/frontend/src/utils/reshape.cpp +++ b/src/frontends/onnx/frontend/src/utils/reshape.cpp @@ -29,8 +29,9 @@ using namespace ov::op; using ov::Shape; -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace reshape { std::vector infer_dimensions(const std::string& node_name, const std::vector& input_shape, @@ -115,10 +116,9 @@ ov::Output reshape_channel_shaped_node_to_nchw(const ov::Output reshape(const Output& value, const Shape& shape) { diff --git a/src/frontends/onnx/frontend/src/utils/reshape.hpp b/src/frontends/onnx/frontend/src/utils/reshape.hpp index 400042e927d9c1..1000f52c4e4d7d 100644 --- a/src/frontends/onnx/frontend/src/utils/reshape.hpp +++ b/src/frontends/onnx/frontend/src/utils/reshape.hpp @@ -11,8 +11,9 @@ #include "openvino/core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace reshape { /// \brief Infer `output_shape` dimension values. /// @@ -61,10 +62,9 @@ ov::Output reshape_channel_shaped_node_to_nchw(const ov::Output& expected_rank); } // namespace reshape -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend -namespace ov { namespace op { namespace util { /// \brief Change shape of a value 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 d96f354c65e1c5..677b2d63fb9342 100644 --- a/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp +++ b/src/frontends/onnx/frontend/src/utils/tensor_external_data.cpp @@ -11,10 +11,11 @@ #include "openvino/util/file_util.hpp" #include "openvino/util/log.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace detail { -TensorExternalData::TensorExternalData(const ONNX_NAMESPACE::TensorProto& tensor) { +TensorExternalData::TensorExternalData(const TensorProto& tensor) { for (const auto& entry : tensor.external_data()) { if (entry.key() == "location") { m_data_location = ov::util::sanitize_path(entry.value()); @@ -103,5 +104,6 @@ std::string TensorExternalData::to_string() const { return s.str(); } } // namespace detail -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/tensor_external_data.hpp b/src/frontends/onnx/frontend/src/utils/tensor_external_data.hpp index eb04e001e7ed4c..28a8860007d0c3 100644 --- a/src/frontends/onnx/frontend/src/utils/tensor_external_data.hpp +++ b/src/frontends/onnx/frontend/src/utils/tensor_external_data.hpp @@ -10,16 +10,18 @@ #include "openvino/runtime/shared_buffer.hpp" #include "openvino/util/mmap_object.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace detail { +using ::ONNX_NAMESPACE::TensorProto; template using Buffer = std::shared_ptr>>; using MappedMemoryHandles = std::shared_ptr>>; /// \brief Helper class used to load tensor data from external files class TensorExternalData { public: - TensorExternalData(const ONNX_NAMESPACE::TensorProto& tensor); + TensorExternalData(const TensorProto& tensor); /// \brief Load external data from tensor passed to constructor /// @@ -51,5 +53,6 @@ class TensorExternalData { std::string m_sha1_digest{}; }; } // namespace detail -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/frontend/src/utils/variadic.hpp b/src/frontends/onnx/frontend/src/utils/variadic.hpp index 553d61eb90c2a9..1a6abb0fa02de5 100644 --- a/src/frontends/onnx/frontend/src/utils/variadic.hpp +++ b/src/frontends/onnx/frontend/src/utils/variadic.hpp @@ -7,11 +7,11 @@ #include #include "core/node.hpp" -#include "openvino/core/deprecated.hpp" #include "utils/common.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace variadic { /// \brief Create an OpenVINO version of an ONNX variadic operation. /// This creates a subgraph with a series of binary operations. @@ -21,7 +21,7 @@ namespace variadic { /// \tparam T Class of an OpenVINO binary operation (e.g. Add, Minimum, Maximum) /// /// \return OpenVINO node equivalent of the ONNX operation -OPENVINO_SUPPRESS_DEPRECATED_START + template inline ov::OutputVector make_ng_variadic_op( const Node& node, @@ -46,10 +46,8 @@ inline ov::OutputVector make_ng_variadic_op( return {result}; } -OPENVINO_SUPPRESS_DEPRECATED_END } // namespace variadic - -} // namespace onnx_import - -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov diff --git a/src/frontends/onnx/onnx_common/include/onnx_common/utils.hpp b/src/frontends/onnx/onnx_common/include/onnx_common/utils.hpp index 62df90c9e7a05b..a26346945dd24b 100644 --- a/src/frontends/onnx/onnx_common/include/onnx_common/utils.hpp +++ b/src/frontends/onnx/onnx_common/include/onnx_common/utils.hpp @@ -10,7 +10,9 @@ namespace ov { namespace frontend { namespace onnx { namespace common { -using namespace ::ONNX_NAMESPACE; +using ::ONNX_NAMESPACE::TensorProto_DataType; +using ::ONNX_NAMESPACE::TensorShapeProto; + /// \brief Retuns size of an ONNX data type in bytes. /// /// \param onnx_type Number assigned to an ONNX data type in the TensorProto_DataType enum. diff --git a/src/frontends/onnx/onnx_common/src/utils.cpp b/src/frontends/onnx/onnx_common/src/utils.cpp index 725826ba95a23b..9b7977fccdadd5 100644 --- a/src/frontends/onnx/onnx_common/src/utils.cpp +++ b/src/frontends/onnx/onnx_common/src/utils.cpp @@ -4,12 +4,10 @@ #include "onnx_common/utils.hpp" -#include - -#include - #include "openvino/core/except.hpp" +using namespace ::ONNX_NAMESPACE; + namespace ov { namespace frontend { namespace onnx { @@ -49,8 +47,6 @@ size_t get_onnx_data_size(int32_t onnx_type) { } OPENVINO_THROW("unsupported element type"); } -namespace { -using namespace ONNX_NAMESPACE; const std::map OV_2_ONNX_TYPES = { {ov::element::Type_t::bf16, TensorProto_DataType::TensorProto_DataType_BFLOAT16}, {ov::element::Type_t::f16, TensorProto_DataType::TensorProto_DataType_FLOAT16}, @@ -65,7 +61,6 @@ const std::map OV_2_ONNX_TYPES = { {ov::element::Type_t::u32, TensorProto_DataType::TensorProto_DataType_UINT32}, {ov::element::Type_t::u64, TensorProto_DataType::TensorProto_DataType_UINT64}, {ov::element::Type_t::boolean, TensorProto_DataType::TensorProto_DataType_BOOL}}; -} // namespace ov::element::Type_t onnx_to_ov_data_type(const TensorProto_DataType& onnx_type) { const auto result = std::find_if(OV_2_ONNX_TYPES.begin(), diff --git a/src/inference/tests/functional/async_infer_request_test.cpp b/src/inference/tests/functional/async_infer_request_test.cpp deleted file mode 100644 index 68b97e5d69bb6d..00000000000000 --- a/src/inference/tests/functional/async_infer_request_test.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include - -using namespace ::testing; -using namespace std; -using namespace InferenceEngine; -using namespace InferenceEngine::details; - -IE_SUPPRESS_DEPRECATED_START - -TEST(InferRequestCPPTests, throwsOnUninitializedSetBlob) { - InferRequest req; - ASSERT_THROW(req.SetBlob({}, {}), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedGetBlob) { - InferRequest req; - ASSERT_THROW(req.GetBlob({}), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedInfer) { - InferRequest req; - ASSERT_THROW(req.Infer(), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedGetPerformanceCounts) { - InferRequest req; - ASSERT_THROW(req.GetPerformanceCounts(), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedSetInput) { - InferRequest req; - ASSERT_THROW(req.SetInput({{}}), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedSetOutput) { - InferRequest req; - ASSERT_THROW(req.SetOutput({{}}), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedStartAsync) { - InferRequest req; - ASSERT_THROW(req.StartAsync(), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedWait) { - InferRequest req; - ASSERT_THROW(req.Wait({}), InferenceEngine::NotAllocated); -} - -TEST(InferRequestCPPTests, throwsOnUninitializedSetCompletionCallback) { - InferRequest req; - std::function f; - ASSERT_THROW(req.SetCompletionCallback(f), InferenceEngine::NotAllocated); -} - -IE_SUPPRESS_DEPRECATED_START - -TEST(InferRequestCPPTests, throwsOnUninitializedCast) { - InferRequest req; - ASSERT_THROW((void)static_cast(req), InferenceEngine::NotAllocated); -} - -IE_SUPPRESS_DEPRECATED_END - -TEST(InferRequestCPPTests, throwsOnUninitializedQueryState) { - InferRequest req; - ASSERT_THROW(req.QueryState(), InferenceEngine::NotAllocated); -} diff --git a/src/inference/tests/functional/cnn_network_test.cpp b/src/inference/tests/functional/cnn_network_test.cpp deleted file mode 100644 index 8430248649aa0c..00000000000000 --- a/src/inference/tests/functional/cnn_network_test.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include - -#include "cpp/ie_cnn_network.h" -#include "inference_engine.hpp" -#include "openvino/opsets/opset.hpp" -#include "openvino/pass/serialize.hpp" -#include "openvino/util/file_util.hpp" - -using namespace InferenceEngine; - -using CNNNetworkTests = ::testing::Test; - -IE_SUPPRESS_DEPRECATED_START - -TEST_F(CNNNetworkTests, throwsOnInitWithNull) { - std::shared_ptr nlptr = nullptr; - ASSERT_THROW(CNNNetwork network(nlptr), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnUninitializedCastToICNNNetwork) { - CNNNetwork network; - ASSERT_THROW((void)static_cast(network), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnConstUninitializedCastToICNNNetwork) { - const CNNNetwork network; - ASSERT_THROW((void)static_cast(network), InferenceEngine::Exception); -} - -IE_SUPPRESS_DEPRECATED_END - -TEST_F(CNNNetworkTests, throwsOnInitWithNullNgraph) { - std::shared_ptr nlptr = nullptr; - ASSERT_THROW(CNNNetwork network(nlptr), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnUninitializedGetOutputsInfo) { - CNNNetwork network; - ASSERT_THROW(network.getOutputsInfo(), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnUninitializedGetInputsInfo) { - CNNNetwork network; - ASSERT_THROW(network.getInputsInfo(), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnUninitializedLayerCount) { - CNNNetwork network; - ASSERT_THROW(network.layerCount(), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnUninitializedGetName) { - CNNNetwork network; - ASSERT_THROW(network.getName(), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnUninitializedGetFunction) { - CNNNetwork network; - ASSERT_THROW(network.getFunction(), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnConstUninitializedGetFunction) { - const CNNNetwork network; - ASSERT_THROW(network.getFunction(), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnConstUninitializedBegin) { - CNNNetwork network; - ASSERT_THROW(network.getFunction(), InferenceEngine::Exception); -} - -TEST_F(CNNNetworkTests, throwsOnConstUninitializedGetInputShapes) { - CNNNetwork network; - ASSERT_THROW(network.getInputShapes(), InferenceEngine::Exception); -} - -static std::shared_ptr CNNNetworkTests_create_model() { - auto param1 = std::make_shared(ov::element::f32, ov::PartialShape::dynamic()); - param1->set_friendly_name("p1_friendly"); - param1->output(0).set_names({"p1_1", "p1_2"}); - auto param2 = std::make_shared(ov::element::f32, ov::PartialShape{-1, 3, 224, 224}); - param2->set_friendly_name("p2_friendly"); - param2->output(0).set_names({"p2_1", "p2_2"}); - auto param3 = std::make_shared(ov::element::f32, ov::PartialShape{1, 3, 224, 224}); - param3->set_friendly_name("p3_friendly"); - param3->output(0).set_names({"p3_1", "p3_2"}); - return std::make_shared(ov::OutputVector{param1, param2, param3}, - ov::ParameterVector{param1, param2, param3}); -} - -TEST_F(CNNNetworkTests, throwsHasDynamicInputs) { - auto model = CNNNetworkTests_create_model(); - CNNNetwork network(model); - InferenceEngine::Core core; - try { - core.LoadNetwork(network); - FAIL() << "LoadNetwork with dynamic inputs shall throw"; - } catch (const InferenceEngine::Exception& e) { - EXPECT_TRUE(std::string(e.what()).find("InferenceEngine::Core::LoadNetwork") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p1_1") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p1_2") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p2_1") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p2_2") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p3_1") == std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p3_2") == std::string::npos) << e.what(); - } -} - -TEST_F(CNNNetworkTests, throwsHasDynamicInputs_queryNetwork) { - auto model = CNNNetworkTests_create_model(); - CNNNetwork network(model); - InferenceEngine::Core core; - try { - core.QueryNetwork(network, "mock"); - FAIL() << "QueryNetwork with dynamic inputs shall throw"; - } catch (const InferenceEngine::Exception& e) { - EXPECT_TRUE(std::string(e.what()).find("InferenceEngine::Core::QueryNetwork") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p1_1") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p1_2") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p2_1") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p2_2") != std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p3_1") == std::string::npos) << e.what(); - EXPECT_TRUE(std::string(e.what()).find("p3_2") == std::string::npos) << e.what(); - } -} diff --git a/src/inference/tests/functional/core_threading.cpp b/src/inference/tests/functional/core_threading.cpp deleted file mode 100644 index 92b13f8b083c46..00000000000000 --- a/src/inference/tests/functional/core_threading.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "openvino/util/file_util.hpp" -#ifdef __GLIBC__ -# include -# if __GLIBC_MINOR__ < 34 -# define OV_TEST_GLIBC_VERSION_LESS_2_34 -# endif -#endif - -class IECoreThreadingTests : public ::testing::Test { -protected: - std::string modelName = "IECoreThreadingTests.xml", weightsName = "IECoreThreadingTests.bin"; - -public: - void SetUp() override { - auto prefix = ov::test::utils::generateTestFilePrefix(); - modelName = prefix + modelName; - weightsName = prefix + weightsName; - ov::test::utils::generate_test_model(modelName, weightsName); - } - - void TearDown() override { - ov::test::utils::removeIRFiles(modelName, weightsName); - } - - void runParallel(std::function func, - const unsigned int iterations = 100, - const unsigned int threadsNum = 8) { - std::vector threads(threadsNum); - - for (auto& thread : threads) { - thread = std::thread([&]() { - for (unsigned int i = 0; i < iterations; ++i) { - func(); - } - }); - } - - for (auto& thread : threads) { - if (thread.joinable()) - thread.join(); - } - } -}; - -// tested function: SetConfig -TEST_F(IECoreThreadingTests, SetConfigPluginDoesNotExist) { - InferenceEngine::Core ie; - std::map localConfig = {{ov::enable_profiling.name(), "YES"}}; - - runParallel( - [&]() { - ie.SetConfig(localConfig); - }, - 10000); -} - -// TODO: CVS-68982 -#ifndef OPENVINO_STATIC_LIBRARY - -// tested function: RegisterPlugin -TEST_F(IECoreThreadingTests, RegisterPlugin) { - InferenceEngine::Core ie; - std::atomic index{0}; - runParallel( - [&]() { - const std::string deviceName = std::to_string(index++); - ie.RegisterPlugin(ov::util::make_plugin_library_name(ov::test::utils::getExecutableDirectory(), - std::string("mock_engine") + OV_BUILD_POSTFIX), - deviceName); - ie.GetVersions(deviceName); - ie.UnregisterPlugin(deviceName); - }, - 4000); -} - -// tested function: RegisterPlugins -TEST_F(IECoreThreadingTests, RegisterPlugins) { - InferenceEngine::Core ie; - std::atomic index{0}; - - auto getPluginXml = [&]() -> std::tuple { - std::string indexStr = std::to_string(index++); - std::string pluginsXML = "test_plugins" + indexStr + ".xml"; - std::ofstream file(pluginsXML); - - file << "::file_separator; - file << ov::util::FileTraits::library_prefix(); - file << "mock_engine"; - file << OV_BUILD_POSTFIX; - file << ov::util::FileTraits::dot_symbol; - file << ov::util::FileTraits::library_ext(); - file << "\" name=\""; - file << indexStr; - file << "\">"; - file.flush(); - file.close(); - - return std::tie(pluginsXML, indexStr); - }; - - runParallel( - [&]() { - std::string fileName, deviceName; - std::tie(fileName, deviceName) = getPluginXml(); - ie.RegisterPlugins(fileName); - ie.GetVersions(deviceName); - ASSERT_EQ(0, std::remove(fileName.c_str())); - }, - 1000); -} - -#endif // !OPENVINO_STATIC_LIBRARY - -// tested function: GetAvailableDevices, UnregisterPlugin -// TODO: some initialization (e.g. thread/dlopen) sporadically fails during such stress-test scenario -TEST_F(IECoreThreadingTests, GetAvailableDevices) { -#ifdef OV_TEST_GLIBC_VERSION_LESS_2_34 - GTEST_SKIP(); -#endif - InferenceEngine::Core ie; - runParallel( - [&]() { - std::vector devices = ie.GetAvailableDevices(); - - // unregister all the devices - for (auto&& deviceName : devices) { - try { - ie.UnregisterPlugin(deviceName); - } catch (const InferenceEngine::Exception& ex) { - // if several threads unload plugin at once, the first thread does this - // while all others will throw an exception that plugin is not registered - ASSERT_STR_CONTAINS(ex.what(), "name is not registered in the"); - } - } - }, - 30); -} diff --git a/src/inference/tests/functional/data_test.cpp b/src/inference/tests/functional/data_test.cpp deleted file mode 100644 index e3ff4e6f69f1d0..00000000000000 --- a/src/inference/tests/functional/data_test.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include - -using namespace ::testing; -using namespace std; -using namespace InferenceEngine; -IE_SUPPRESS_DEPRECATED_START - -class DataTests : public ::testing::Test { -protected: - const std::string data_name = "test_data_name"; - const Precision precision = Precision::FP32; - - const SizeVector notEmptyDims = {1, 1, 1, 1}; - const SizeVector emptyDims = {}; - const size_t batchSize = 1; - - class BlockingDescTest : public BlockingDesc { - public: - BlockingDescTest(const SizeVector& blocked_dims, const SizeVector& order) : BlockingDesc(blocked_dims, order) {} - - void fillDescTest(const SizeVector& blocked_dims, const SizeVector& order) { - fillDesc(blocked_dims, order); - } - }; -}; - -TEST_F(DataTests, canSetEmptyDimsForDataDefault) { - Data data(data_name, precision); - ASSERT_NO_THROW(data.setDims(emptyDims)); - ASSERT_FALSE(data.isInitialized()); -} - -TEST_F(DataTests, canSetEmptyDimsForDataBlocked) { - Data data(data_name, precision, BLOCKED); - ASSERT_NO_THROW(data.setDims(emptyDims)); -} - -TEST_F(DataTests, canSetNotEmptyDimsForDataBlocked) { - Data data(data_name, precision, BLOCKED); - ASSERT_NO_THROW(data.setDims(notEmptyDims)); -} - -TEST_F(DataTests, canSetNotEmptyDimsForDataNCHW) { - Data data(data_name, precision, NCHW); - ASSERT_NO_THROW(data.setDims(notEmptyDims)); - ASSERT_TRUE(data.isInitialized()); -} - -TEST_F(DataTests, canSetEmptyDimsForTensorDescNCHW) { - TensorDesc desc(precision, emptyDims, NCHW); - ASSERT_NO_THROW(desc.setDims(emptyDims)); -} - -TEST_F(DataTests, canSetEmptyDimsForTensorDescBlocked) { - TensorDesc desc(precision, emptyDims, BLOCKED); - ASSERT_NO_THROW(desc.setDims(emptyDims)); -} - -TEST_F(DataTests, canSetNotEmptyDimsForTensorDescBlocked) { - TensorDesc desc(precision, notEmptyDims, BLOCKED); - ASSERT_NO_THROW(desc.setDims(notEmptyDims)); -} - -TEST_F(DataTests, canSetEmptyDimsForBlockingDescOrder) { - ASSERT_NO_THROW(BlockingDesc(emptyDims, emptyDims)); -} - -TEST_F(DataTests, throwOnFillDescByEmptyDimsForBlockingDesc) { - BlockingDescTest desc(emptyDims, emptyDims); - ASSERT_THROW(desc.fillDescTest(emptyDims, emptyDims), Exception); -} - -TEST_F(DataTests, throwOnSetEmptyDimsForBlockingDescBlocked) { - ASSERT_NO_THROW(BlockingDesc(emptyDims, BLOCKED)); -} - -TEST_F(DataTests, throwOnSetEmptyDimsForBlockingDescNCHW) { - ASSERT_NO_THROW(BlockingDesc(emptyDims, NCHW)); -} - -TEST_F(DataTests, canSetNotEmptyDimsForBlockingDescBlocked) { - ASSERT_NO_THROW(BlockingDesc(notEmptyDims, BLOCKED)); -} - -TEST_F(DataTests, canSetNotEmptyDimsForBlockingDescNCHW) { - ASSERT_NO_THROW(BlockingDesc(notEmptyDims, NCHW)); -} - -TEST_F(DataTests, setPrecision) { - Data data(data_name, {Precision::FP32, emptyDims, Layout::NCHW}); - - EXPECT_EQ(Precision::FP32, data.getPrecision()); - EXPECT_EQ(Precision::FP32, data.getTensorDesc().getPrecision()); - - data.setPrecision(Precision::FP16); - EXPECT_EQ(Precision::FP16, data.getPrecision()); - EXPECT_EQ(Precision::FP16, data.getTensorDesc().getPrecision()); -} diff --git a/src/inference/tests/functional/executable_network.cpp b/src/inference/tests/functional/executable_network.cpp deleted file mode 100644 index 5d741e876749c4..00000000000000 --- a/src/inference/tests/functional/executable_network.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include - -using namespace ::testing; -using namespace std; -using namespace InferenceEngine; -using namespace InferenceEngine::details; - -TEST(ExecutableNetworkTests, throwsOnUninitializedGetOutputsInfo) { - ExecutableNetwork exec; - ASSERT_THROW(exec.GetOutputsInfo(), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, throwsOnUninitializedGetInputsInfo) { - ExecutableNetwork exec; - ASSERT_THROW(exec.GetInputsInfo(), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, throwsOnUninitializedExport) { - ExecutableNetwork exec; - ASSERT_THROW(exec.Export(std::string()), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, throwsOnUninitializedExportStream) { - ExecutableNetwork exec; - ASSERT_THROW(exec.Export(std::cout), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, throwsOnUninitializedGetExecGraphInfo) { - ExecutableNetwork exec; - ASSERT_THROW(exec.GetExecGraphInfo(), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, throwsOnUninitializedSetConfig) { - ExecutableNetwork exec; - ASSERT_THROW(exec.SetConfig({{}}), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, throwsOnUninitializedGetConfig) { - ExecutableNetwork exec; - ASSERT_THROW(exec.GetConfig({}), InferenceEngine::NotAllocated); -} - -TEST(ExecutableNetworkTests, throwsOnUninitializedGetMetric) { - ExecutableNetwork exec; - ASSERT_THROW(exec.GetMetric({}), InferenceEngine::NotAllocated); -} diff --git a/src/inference/tests/functional/ie_precision_test.cpp b/src/inference/tests/functional/ie_precision_test.cpp deleted file mode 100644 index 65bb27f0e476ab..00000000000000 --- a/src/inference/tests/functional/ie_precision_test.cpp +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include - -#include -#include - -IE_SUPPRESS_DEPRECATED_START - -using Precision = InferenceEngine::Precision; - -using PrecisionTests = ::testing::Test; - -TEST_F(PrecisionTests, ShowsCorrectPrecisionNames) { - EXPECT_STREQ(Precision(Precision::I64).name(), "I64"); - EXPECT_STREQ(Precision(Precision::U64).name(), "U64"); - EXPECT_STREQ(Precision(Precision::BF16).name(), "BF16"); - EXPECT_STREQ(Precision(Precision::FP16).name(), "FP16"); - EXPECT_STREQ(Precision(Precision::FP32).name(), "FP32"); - EXPECT_STREQ(Precision(Precision::FP64).name(), "FP64"); - EXPECT_STREQ(Precision(Precision::I16).name(), "I16"); - EXPECT_STREQ(Precision(Precision::I32).name(), "I32"); - EXPECT_STREQ(Precision(Precision::U32).name(), "U32"); - EXPECT_STREQ(Precision(Precision::U16).name(), "U16"); - EXPECT_STREQ(Precision(Precision::I4).name(), "I4"); - EXPECT_STREQ(Precision(Precision::I8).name(), "I8"); - EXPECT_STREQ(Precision(Precision::Q78).name(), "Q78"); - EXPECT_STREQ(Precision(Precision::U4).name(), "U4"); - EXPECT_STREQ(Precision(Precision::U8).name(), "U8"); - EXPECT_STREQ(Precision(Precision::MIXED).name(), "MIXED"); - EXPECT_STREQ(Precision(Precision::UNSPECIFIED).name(), "UNSPECIFIED"); - EXPECT_STREQ(Precision(static_cast(-3)).name(), "UNSPECIFIED"); - EXPECT_STREQ(Precision(1, "Custom Name").name(), "Custom Name"); -} - -TEST_F(PrecisionTests, sizeIsCorrect) { - EXPECT_EQ(Precision(Precision::I64).size(), 8); - EXPECT_EQ(Precision(Precision::U64).size(), 8); - EXPECT_EQ(Precision(Precision::BF16).size(), 2); - EXPECT_EQ(Precision(Precision::FP16).size(), 2); - EXPECT_EQ(Precision(Precision::FP32).size(), 4); - EXPECT_EQ(Precision(Precision::FP64).size(), 8); - EXPECT_EQ(Precision(Precision::I32).size(), 4); - EXPECT_EQ(Precision(Precision::U32).size(), 4); - EXPECT_EQ(Precision(Precision::I16).size(), 2); - EXPECT_EQ(Precision(Precision::U16).size(), 2); - EXPECT_EQ(Precision(Precision::I4).size(), 1); - EXPECT_EQ(Precision(Precision::I8).size(), 1); - EXPECT_EQ(Precision(Precision::Q78).size(), 2); - EXPECT_EQ(Precision(Precision::U8).size(), 1); - EXPECT_EQ(Precision(Precision::U4).size(), 1); - EXPECT_EQ(Precision(10 * 8).size(), 10); - EXPECT_THROW(Precision(Precision::MIXED).size(), InferenceEngine::Exception); - EXPECT_THROW(Precision(Precision::UNSPECIFIED).size(), InferenceEngine::Exception); -} - -TEST_F(PrecisionTests, bitsSizeIsCorrect) { - EXPECT_EQ(Precision(Precision::I64).bitsSize(), 64); - EXPECT_EQ(Precision(Precision::U64).bitsSize(), 64); - EXPECT_EQ(Precision(Precision::BF16).bitsSize(), 16); - EXPECT_EQ(Precision(Precision::FP16).bitsSize(), 16); - EXPECT_EQ(Precision(Precision::FP32).bitsSize(), 32); - EXPECT_EQ(Precision(Precision::FP64).bitsSize(), 64); - EXPECT_EQ(Precision(Precision::I32).bitsSize(), 32); - EXPECT_EQ(Precision(Precision::U32).bitsSize(), 32); - EXPECT_EQ(Precision(Precision::I16).bitsSize(), 16); - EXPECT_EQ(Precision(Precision::U16).bitsSize(), 16); - EXPECT_EQ(Precision(Precision::I4).bitsSize(), 4); - EXPECT_EQ(Precision(Precision::I8).bitsSize(), 8); - EXPECT_EQ(Precision(Precision::Q78).bitsSize(), 16); - EXPECT_EQ(Precision(Precision::U8).bitsSize(), 8); - EXPECT_EQ(Precision(Precision::U4).bitsSize(), 4); - EXPECT_EQ(Precision(10 * 8).bitsSize(), 80); - EXPECT_THROW(Precision(Precision::MIXED).bitsSize(), InferenceEngine::Exception); - EXPECT_THROW(Precision(Precision::UNSPECIFIED).bitsSize(), InferenceEngine::Exception); -} - -TEST_F(PrecisionTests, is_float) { - EXPECT_TRUE(Precision(Precision::BF16).is_float()); - EXPECT_TRUE(Precision(Precision::FP16).is_float()); - EXPECT_TRUE(Precision(Precision::FP32).is_float()); - EXPECT_TRUE(Precision(Precision::FP64).is_float()); - EXPECT_FALSE(Precision(Precision::I64).is_float()); - EXPECT_FALSE(Precision(Precision::U64).is_float()); - EXPECT_FALSE(Precision(Precision::I32).is_float()); - EXPECT_FALSE(Precision(Precision::U32).is_float()); - EXPECT_FALSE(Precision(Precision::I16).is_float()); - EXPECT_FALSE(Precision(Precision::U16).is_float()); - EXPECT_FALSE(Precision(Precision::I8).is_float()); - EXPECT_FALSE(Precision(Precision::I4).is_float()); - EXPECT_FALSE(Precision(Precision::Q78).is_float()); - EXPECT_FALSE(Precision(Precision::U4).is_float()); - EXPECT_FALSE(Precision(Precision::U8).is_float()); - EXPECT_FALSE(Precision(Precision::MIXED).is_float()); - EXPECT_FALSE(Precision(10).is_float()); - EXPECT_FALSE(Precision(static_cast(-3)).is_float()); - EXPECT_FALSE(Precision(Precision::UNSPECIFIED).is_float()); -} - -TEST_F(PrecisionTests, constructFromSTR) { - EXPECT_EQ(Precision(Precision::I64), Precision::FromStr("I64")); - EXPECT_EQ(Precision(Precision::U64), Precision::FromStr("U64")); - EXPECT_EQ(Precision(Precision::BF16), Precision::FromStr("BF16")); - EXPECT_EQ(Precision(Precision::FP16), Precision::FromStr("FP16")); - EXPECT_EQ(Precision(Precision::FP32), Precision::FromStr("FP32")); - EXPECT_EQ(Precision(Precision::FP64), Precision::FromStr("FP64")); - EXPECT_EQ(Precision(Precision::I32), Precision::FromStr("I32")); - EXPECT_EQ(Precision(Precision::U32), Precision::FromStr("U32")); - EXPECT_EQ(Precision(Precision::I16), Precision::FromStr("I16")); - EXPECT_EQ(Precision(Precision::U16), Precision::FromStr("U16")); - EXPECT_EQ(Precision(Precision::I4), Precision::FromStr("I4")); - EXPECT_EQ(Precision(Precision::I8), Precision::FromStr("I8")); - EXPECT_EQ(Precision(Precision::Q78), Precision::FromStr("Q78")); - EXPECT_EQ(Precision(Precision::U4), Precision::FromStr("U4")); - EXPECT_EQ(Precision(Precision::U8), Precision::FromStr("U8")); - EXPECT_EQ(Precision(Precision::MIXED), Precision::FromStr("MIXED")); - EXPECT_EQ(Precision(static_cast(-3)), Precision::FromStr("UNSPECIFIED")); - EXPECT_EQ(Precision(Precision::UNSPECIFIED), Precision::FromStr("UNSPECIFIED")); -} - -TEST_F(PrecisionTests, canCompareCustomPrecisions) { - Precision p(12); - Precision p1(12, "XXX"); - EXPECT_FALSE(p == p1); - - std::string d; - d.push_back('X'); - d.push_back('X'); - d.push_back('X'); - Precision p2(12, d.c_str()); - EXPECT_TRUE(p2 == p1); - - Precision p3(13, "XXX"); - EXPECT_FALSE(p3 == p1); - - Precision p4(13); - EXPECT_FALSE(p4 == p); - - Precision p5(12); - EXPECT_TRUE(p5 == p); -} - -TEST_F(PrecisionTests, canUseInIfs) { - Precision p; - EXPECT_TRUE(!p); - p = Precision::FP32; - EXPECT_FALSE(!p); - EXPECT_TRUE(p); - p = Precision(static_cast(-3)); - EXPECT_TRUE(!p); -} - -TEST_F(PrecisionTests, canCreateFromStruct) { - struct X { - int a; - int b; - }; - auto precision = Precision::fromType(); - EXPECT_EQ(precision.size(), sizeof(X)); -} - -TEST_F(PrecisionTests, canCreateMoreThan255bitsPrecisions) { - struct Y { - uint8_t a[257]; - }; - - EXPECT_NO_THROW(Precision::fromType()); - EXPECT_EQ(Precision::fromType().size(), 257); -} diff --git a/src/inference/tests/functional/ov_extension_test.cpp b/src/inference/tests/functional/ov_extension_test.cpp index 08a60b81e44e08..ca2cefca071745 100644 --- a/src/inference/tests/functional/ov_extension_test.cpp +++ b/src/inference/tests/functional/ov_extension_test.cpp @@ -8,7 +8,6 @@ #include "openvino/util/file_util.hpp" using namespace testing; -using namespace InferenceEngine; using namespace ov::test::utils; namespace { diff --git a/src/inference/tests/functional/ov_infer_request_test.cpp b/src/inference/tests/functional/ov_infer_request_test.cpp index 8aede54728dccc..935b056b2fef7e 100644 --- a/src/inference/tests/functional/ov_infer_request_test.cpp +++ b/src/inference/tests/functional/ov_infer_request_test.cpp @@ -12,8 +12,6 @@ using namespace ::testing; using namespace std; -using namespace InferenceEngine; -using namespace InferenceEngine::details; TEST(InferRequestOVTests, throwsOnUninitializedSetTensor) { ov::InferRequest req; diff --git a/src/inference/tests/functional/pre_allocator_test.cpp b/src/inference/tests/functional/pre_allocator_test.cpp deleted file mode 100644 index eb0099884050dd..00000000000000 --- a/src/inference/tests/functional/pre_allocator_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include - -#include "details/ie_pre_allocator.hpp" -#include "ie_allocator.hpp" - -using namespace ::testing; -using namespace std; -using namespace InferenceEngine; - -IE_SUPPRESS_DEPRECATED_START - -class PreallocatorTests : public ::testing::Test { -protected: - std::vector mybuf; - - void SetUp() override { - mybuf.resize(10); - allocator = details::make_pre_allocator(&*mybuf.begin(), mybuf.size()); - } - std::shared_ptr allocator; -}; - -TEST_F(PreallocatorTests, canAccessPreAllocatedMemory) { - void* handle = allocator->alloc(3); - float* ptr = reinterpret_cast(allocator->lock(handle)); - - mybuf = {1.1f, 2.2f, 3.3f}; - - ASSERT_EQ(ptr, &*mybuf.begin()); - ASSERT_EQ(ptr[0], 1.1f); - ASSERT_EQ(ptr[1], 2.2f); - ASSERT_EQ(ptr[2], 3.3f); -} - -TEST_F(PreallocatorTests, canNotAllocateMoreMemory) { - // large block such as 10k will result in nullptr - EXPECT_EQ(nullptr, allocator->lock(allocator->alloc(10 * sizeof(float) + 1))); - EXPECT_NE(nullptr, allocator->lock(allocator->alloc(10 * sizeof(float)))); -} - -TEST_F(PreallocatorTests, canNotLockWrongHandle) { - void* handle = allocator->alloc(3); - EXPECT_EQ(nullptr, allocator->lock(1 + reinterpret_cast(handle))); -} diff --git a/src/inference/tests/functional/tensor_desc_test.cpp b/src/inference/tests/functional/tensor_desc_test.cpp deleted file mode 100644 index 64dc1372e926c1..00000000000000 --- a/src/inference/tests/functional/tensor_desc_test.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include - -#include -#include - -using namespace ::testing; -using namespace std; -using namespace InferenceEngine; - -IE_SUPPRESS_DEPRECATED_START - -using TensorDescTests = ::testing::Test; - -TEST_F(TensorDescTests, CreateBlobWithIncorrectLayout) { - ASSERT_THROW(make_shared_blob({Precision::FP32, {1, 3, 32}, Layout::NC}), Exception); -} - -TEST_F(TensorDescTests, CreateBlockedBlobNCHW) { - TensorDesc desc(Precision::FP32, {1, 4, 2, 1}, {{1, 2, 2, 1, 2}, {0, 1, 2, 3, 1}}); - float data[8] = {1, 2, 3, 4, 5, 6, 7, 8}; - Blob::Ptr blockedBlob = make_shared_blob(desc, data); - Blob::Ptr nchwBlob = make_shared_blob({Precision::FP32, {1, 4, 2, 1}, Layout::NCHW}, data); - ASSERT_NE(blockedBlob->getTensorDesc().offset(5), nchwBlob->getTensorDesc().offset(5)); - ASSERT_EQ(6, blockedBlob->getTensorDesc().offset(5)); - ASSERT_EQ(5, nchwBlob->getTensorDesc().offset(5)); - ASSERT_EQ(Layout::NCHW, nchwBlob->getTensorDesc().getLayout()); - ASSERT_EQ(Layout::BLOCKED, blockedBlob->getTensorDesc().getLayout()); -} - -TEST_F(TensorDescTests, CreateBlockedBlobNCDHW) { - TensorDesc desc(Precision::FP32, {1, 4, 2, 2, 1}, {{1, 2, 2, 2, 1, 2}, {0, 1, 2, 3, 4, 1}}); - float data[8] = {1, 2, 3, 4, 5, 6, 7, 8}; - Blob::Ptr blockedBlob = make_shared_blob(desc, data); - Blob::Ptr ncdhwBlob = make_shared_blob({Precision::FP32, {1, 4, 2, 2, 1}, Layout::NCDHW}, data); - ASSERT_NE(blockedBlob->getTensorDesc().offset(6), ncdhwBlob->getTensorDesc().offset(6)); - ASSERT_EQ(5, blockedBlob->getTensorDesc().offset(6)); - ASSERT_EQ(6, ncdhwBlob->getTensorDesc().offset(6)); - ASSERT_EQ(Layout::NCDHW, ncdhwBlob->getTensorDesc().getLayout()); - ASSERT_EQ(Layout::BLOCKED, blockedBlob->getTensorDesc().getLayout()); -} - -TEST_F(TensorDescTests, CompareHWCandCHWLayouts) { - TensorDesc descCHW(Precision::FP32, {1, 3, 4}, Layout::CHW); - TensorDesc descHWC(Precision::FP32, {1, 3, 4}, Layout::HWC); - SizeVector chw = {0, 1, 2}; - SizeVector hwc = {1, 2, 0}; - - ASSERT_NE(descCHW, descHWC); - ASSERT_NE(descCHW.getBlockingDesc(), descHWC.getBlockingDesc()); - ASSERT_NE(descCHW.getBlockingDesc().getOrder(), descHWC.getBlockingDesc().getOrder()); - ASSERT_EQ(descCHW.getBlockingDesc().getOrder(), chw); - ASSERT_EQ(descHWC.getBlockingDesc().getOrder(), hwc); -} - -TEST_F(TensorDescTests, CompareNHWCandNCHWLayouts) { - TensorDesc descNCHW(Precision::FP32, {1, 3, 4, 2}, Layout::NCHW); - TensorDesc descNHWC(Precision::FP32, {1, 3, 4, 2}, Layout::NHWC); - SizeVector nchw = {0, 1, 2, 3}; - SizeVector nhwc = {0, 2, 3, 1}; - - ASSERT_NE(descNCHW, descNHWC); - ASSERT_NE(descNCHW.getBlockingDesc(), descNHWC.getBlockingDesc()); - ASSERT_NE(descNCHW.getBlockingDesc().getOrder(), descNHWC.getBlockingDesc().getOrder()); - ASSERT_EQ(descNCHW.getBlockingDesc().getOrder(), nchw); - ASSERT_EQ(descNHWC.getBlockingDesc().getOrder(), nhwc); -} - -TEST_F(TensorDescTests, CompareNDHWCandNCDHWLayouts) { - TensorDesc descNCDHW(Precision::FP32, {1, 3, 4, 4, 2}, Layout::NCDHW); - TensorDesc descNDHWC(Precision::FP32, {1, 3, 4, 4, 2}, Layout::NDHWC); - SizeVector ncdhw = {0, 1, 2, 3, 4}; - SizeVector ndhwc = {0, 2, 3, 4, 1}; - - ASSERT_NE(descNCDHW, descNDHWC); - ASSERT_NE(descNCDHW.getBlockingDesc(), descNDHWC.getBlockingDesc()); - ASSERT_NE(descNCDHW.getBlockingDesc().getOrder(), descNDHWC.getBlockingDesc().getOrder()); - ASSERT_EQ(descNCDHW.getBlockingDesc().getOrder(), ncdhw); - ASSERT_EQ(descNDHWC.getBlockingDesc().getOrder(), ndhwc); -} - -TEST_F(TensorDescTests, SetLayout) { - TensorDesc descNCHW(Precision::FP32, {1, 2, 3, 4}, Layout::NCHW); - TensorDesc decsNHWC = descNCHW; - decsNHWC.setLayout(Layout::NHWC); - - TensorDesc refNHWC(descNCHW.getPrecision(), descNCHW.getDims(), Layout::NHWC); - ASSERT_EQ(decsNHWC, refNHWC); -} - -TEST_F(TensorDescTests, setDimsForBLOCKED) { - TensorDesc desc(Precision::FP32, {1, 2, 3, 4, 5, 6}, Layout::BLOCKED); - SizeVector newDims{7, 7, 7, 7, 7, 7}; - desc.setDims(newDims); - EXPECT_EQ(desc.getDims(), newDims); - EXPECT_EQ(desc.getBlockingDesc().getBlockDims(), newDims); -} - -TEST_F(TensorDescTests, setDimsForNHWC) { - TensorDesc desc(Precision::FP32, {1, 2, 3, 4}, Layout::NHWC); - auto refOrder = desc.getBlockingDesc().getOrder(); - SizeVector newDims{7, 7, 7, 7}; - desc.setDims(newDims); - EXPECT_EQ(desc.getDims(), newDims); - EXPECT_EQ(desc.getLayout(), Layout::NHWC); - EXPECT_EQ(desc.getBlockingDesc().getBlockDims(), newDims); - EXPECT_EQ(desc.getBlockingDesc().getOrder(), refOrder); -} diff --git a/src/inference/tests/functional/variable_state.cpp b/src/inference/tests/functional/variable_state.cpp deleted file mode 100644 index 5d23b4b7132614..00000000000000 --- a/src/inference/tests/functional/variable_state.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include - -#include "openvino/core/deprecated.hpp" - -using namespace ::testing; -using namespace std; -using namespace InferenceEngine; -using namespace InferenceEngine::details; -OPENVINO_SUPPRESS_DEPRECATED_START - -TEST(VariableStateCPPTests, throwsOnUninitializedReset) { - VariableState req; - ASSERT_THROW(req.Reset(), InferenceEngine::NotAllocated); -} - -TEST(VariableStateCPPTests, throwsOnUninitializedGetname) { - VariableState req; - ASSERT_THROW(req.GetName(), InferenceEngine::NotAllocated); -} - -TEST(VariableStateCPPTests, throwsOnUninitializedGetState) { - VariableState req; - ASSERT_THROW(req.GetState(), InferenceEngine::NotAllocated); -} - -TEST(VariableStateCPPTests, throwsOnUninitializedSetState) { - VariableState req; - Blob::Ptr blob; - ASSERT_THROW(req.SetState(blob), InferenceEngine::NotAllocated); -} diff --git a/src/inference/tests/unit/system_allocator_test.cpp b/src/inference/tests/unit/system_allocator_test.cpp deleted file mode 100644 index bab05bd634d6b3..00000000000000 --- a/src/inference/tests/unit/system_allocator_test.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "system_allocator.hpp" - -#include - -#include - -#include "common_test_utils/test_common.hpp" - -using namespace InferenceEngine; -class SystemAllocatorReleaseTests : public ov::test::TestsCommon {}; - -class SystemAllocatorTests : public ov::test::TestsCommon { -protected: - void SetUp() override { - ov::test::TestsCommon::SetUp(); - ASSERT_EQ(allocator.get(), nullptr); - allocator = createSystemMemoryAllocator(); - ASSERT_NE(allocator.get(), nullptr); - } - - void TearDown() override { - ov::test::TestsCommon::TearDown(); - ASSERT_NE(allocator.get(), nullptr); - allocator.reset(); - ASSERT_EQ(allocator.get(), nullptr); - } - - std::unique_ptr createSystemMemoryAllocator() { - return std::unique_ptr(new SystemMemoryAllocator()); - } - - std::unique_ptr allocator; - -public: -}; - -TEST_F(SystemAllocatorTests, canAllocate) { - void* handle0 = allocator->alloc(0); - void* handle1 = allocator->alloc(100); - EXPECT_NE(handle0, nullptr); - EXPECT_NE(handle1, nullptr); - delete[] reinterpret_cast(handle0); - delete[] reinterpret_cast(handle1); -} - -TEST_F(SystemAllocatorTests, canFree) { - EXPECT_TRUE(allocator->free(nullptr)); - void* handle0 = reinterpret_cast(new char[0]); - void* handle1 = reinterpret_cast(new char[100]); - EXPECT_TRUE(allocator->free(handle0)); - EXPECT_TRUE(allocator->free(handle1)); -} - -TEST_F(SystemAllocatorTests, canLockAndUnlockAllocatedMemory) { - // large block such as 10k will result in sigsegv if not allocated - void* handle = allocator->alloc(10000); - char* ptr = reinterpret_cast(allocator->lock(handle)); - ptr[9999] = 11; - EXPECT_EQ(ptr[9999], 11); - allocator->unlock(ptr); - allocator->free(handle); -} diff --git a/src/plugins/intel_cpu/src/graph.cpp b/src/plugins/intel_cpu/src/graph.cpp index 2c6f5e8ba2fefa..a4c7477a5a04bb 100644 --- a/src/plugins/intel_cpu/src/graph.cpp +++ b/src/plugins/intel_cpu/src/graph.cpp @@ -306,7 +306,7 @@ void Graph::InitDescriptors() { } void Graph::ResolveInplaceDirections() { - OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "Graph::ResolveInplaceDirections"); + OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "Graph::ResolveInplaceDirections"); for (auto& node : graphNodes) { resolveInPlaceDirection(node); diff --git a/src/plugins/intel_cpu/src/graph_optimizer.cpp b/src/plugins/intel_cpu/src/graph_optimizer.cpp index 4b77fec6c0c9dd..b0fa76a845e5b4 100644 --- a/src/plugins/intel_cpu/src/graph_optimizer.cpp +++ b/src/plugins/intel_cpu/src/graph_optimizer.cpp @@ -12,6 +12,7 @@ #include "nodes/eltwise.h" #include "nodes/fake_quantize.h" #include "nodes/fullyconnected.h" +#include "nodes/gather.h" #include "nodes/input.h" #include "nodes/interpolate.h" #include "nodes/memory.hpp" @@ -71,6 +72,10 @@ void GraphOptimizer::ApplyCommonGraphOptimizations(Graph &graph) { FuseFCAndWeightsDecompression(graph); graph.RemoveDroppedNodes(); + OV_ITT_SCOPE_NEXT(FIRST_INFERENCE, taskChain, "FuseGatherAndWeightsDecompression"); + FuseGatherAndWeightsDecompression(graph); + graph.RemoveDroppedNodes(); + OV_ITT_SCOPE_NEXT(FIRST_INFERENCE, taskChain, "FuseConvolutionAndBias"); FuseConvolutionMatMulDeconvAndBias(graph); graph.RemoveDroppedNodes(); @@ -507,6 +512,103 @@ void GraphOptimizer::FuseFCAndWeightsDecompression(Graph &graph) { } } +void GraphOptimizer::FuseGatherAndWeightsDecompression(Graph &graph) { + std::set supportedWeightsPrecisions{ov::element::u8}; + auto expectedNode = [](NodePtr node, Type expectedType) { + return node->getType() == expectedType && node->getChildEdges().size() == 1; + }; + + auto& graphNodes = graph.GetNodes(); + for (size_t i = 0; i < graphNodes.size(); i++) { + const auto gatherNode = dynamic_cast(graphNodes[i].get()); + if (gatherNode == nullptr) + continue; + + // Multiply + const auto multiplyNode = gatherNode->getParentEdgeAt(0)->getParent(); + if (!expectedNode(multiplyNode, Type::Eltwise) || multiplyNode->getAlgorithm() != Algorithm::EltwiseMultiply || + !multiplyNode->isConstant()) + continue; + + CPU_GRAPH_OPTIMIZER_SCOPE(FuseGatherAndWeightsDecompression); + const auto multiplyConstNode = multiplyNode->getParentEdgeAt(1)->getParent(); + if (!expectedNode(multiplyConstNode, Type::Input)) + continue; + + const auto mulParent = multiplyNode->getParentEdgeAt(0)->getParent(); + NodePtr subtractNode = mulParent; + if (!expectedNode(subtractNode, Type::Eltwise)) + continue; + auto subtractConstNode = subtractNode->getParentEdgeAt(1)->getParent(); + if (!expectedNode(subtractConstNode, Type::Input)) + continue; + + auto convertNode = subtractNode->getParentEdgeAt(0)->getParent(); + if (!expectedNode(convertNode, Type::Convert)) + continue; + const auto weightsNode = convertNode->getParentEdgeAt(0)->getParent(); + if (!expectedNode(weightsNode, Type::Input)) + continue; + + // Precision limitations + if (supportedWeightsPrecisions.find(weightsNode->getOriginalOutputPrecisionAtPort(0)) == supportedWeightsPrecisions.end()) + continue; + + // Shape limitations + const auto weightsShape = weightsNode->getOutputShapeAtPort(0); + if (weightsShape != multiplyNode->getOutputShapeAtPort(0)) + continue; + + // Get decompressionConstShape + VectorDims decompressionConstShape; + const auto gatherInputWeightsShape = gatherNode->getInputShapeAtPort(0); + if (gatherInputWeightsShape.getRank() != 2u || weightsShape.getRank() != 2u) + continue; + // Should be [vocab_size, 1] + decompressionConstShape = VectorDims{gatherInputWeightsShape.getDims()[0], 1}; + + auto check_decompression_shape = [&decompressionConstShape](const VectorDims& shape_to_check) { + if (shape_to_check.size() != decompressionConstShape.size()) + return false; + return std::equal(shape_to_check.begin(), shape_to_check.end(), decompressionConstShape.begin()); + }; + if (!check_decompression_shape(multiplyConstNode->getOutputShapeAtPort(0).getDims())) + continue; + if (!check_decompression_shape(subtractConstNode->getOutputShapeAtPort(0).getDims())) + continue; + + // Fusion processing + auto *multiplyInputNode = dynamic_cast(multiplyConstNode.get()); + if (!multiplyInputNode) { + OPENVINO_THROW("Cannot cast ", multiplyInputNode->getName(), " to Input node."); + } + gatherNode->fuseDecompressionMultiply(multiplyInputNode->getMemoryPtr()); + + auto *subtractInputNode = dynamic_cast(subtractConstNode.get()); + if (!subtractInputNode) { + OPENVINO_THROW("Cannot cast ", subtractInputNode->getName(), " to Input node."); + } + gatherNode->fuseDecompressionSubtract(subtractInputNode->getMemoryPtr()); + + gatherNode->addOriginalLayer(multiplyNode->getOriginalLayers()); + gatherNode->addOriginalLayer(convertNode->getOriginalLayers()); + + gatherNode->addOriginalLayer(subtractNode->getOriginalLayers()); + auto subtractConstEdge = subtractConstNode->getChildEdges()[0].lock(); + graph.RemoveEdge(subtractConstEdge); + + auto multiplyConstEdge = multiplyConstNode->getChildEdges()[0].lock(); + graph.RemoveEdge(multiplyConstEdge); + + graph.DropNode(convertNode); + graph.DropNode(subtractNode); + graph.DropNode(multiplyNode); + + const auto& weightsPrecision = weightsNode->getOriginalOutputPrecisionAtPort(0); + gatherNode->setOriginalInputPrecisionAtPort(0, weightsPrecision); + } +} + void GraphOptimizer::FuseConvolutionMatMulDeconvAndBias(Graph &graph) { auto& graphNodes = graph.GetNodes(); diff --git a/src/plugins/intel_cpu/src/graph_optimizer.h b/src/plugins/intel_cpu/src/graph_optimizer.h index 45254aca36304d..0716bedc802c73 100644 --- a/src/plugins/intel_cpu/src/graph_optimizer.h +++ b/src/plugins/intel_cpu/src/graph_optimizer.h @@ -20,6 +20,7 @@ class GraphOptimizer { private: void FuseConvMatmulFCDeconvAndDQScales(Graph &graph); void FuseFCAndWeightsDecompression(Graph &graph); + void FuseGatherAndWeightsDecompression(Graph &graph); void FuseConvolutionMatMulDeconvAndBias(Graph &graph); void FuseDeconvolutionAndSimpleOperation(Graph &graph); void FuseMultiplyAndAdd(Graph &graph); diff --git a/src/plugins/intel_cpu/src/nodes/gather.cpp b/src/plugins/intel_cpu/src/nodes/gather.cpp index 864426d8a0620d..a800dbafdcc694 100644 --- a/src/plugins/intel_cpu/src/nodes/gather.cpp +++ b/src/plugins/intel_cpu/src/nodes/gather.cpp @@ -13,11 +13,16 @@ #include "openvino/core/parallel.hpp" #include #include "common/cpu_memcpy.h" +#include "common/cpu_convert.h" #include "utils/general_utils.h" #include "kernels/x64/gather_uni_kernel.hpp" #include #include "shape_inference/custom/gather.hpp" #include "utils/ngraph_utils.hpp" +#include "snippets/utils.hpp" +#include "memory_desc/dnnl_blocked_memory_desc.h" +#include "openvino/core/type/element_type.hpp" +#include "openvino/core/except.hpp" using namespace dnnl::impl::cpu; @@ -135,10 +140,19 @@ void Gather::initSupportedPrimitiveDescriptors() { // Implementation desc type will be redefined in the fn prepareParams if a kernel will be created. ov::element::Type dataPrecision = getOriginalInputPrecisionAtPort(GATHER_DATA); + + canOptimizeCompressedEmbedding = false; + if ((decompressionSubtractPtr != nullptr) && (decompressionMultiplyPtr != nullptr)) { + if (dataPrecision != ov::element::u8 || !isAxisInputConst || inputShapes[GATHER_DATA].getRank() != 2u) { + OPENVINO_THROW("Compression gather doesn't support demanded precisions, axis, data rank"); + } + canOptimizeCompressedEmbedding = true; + } + addSupportedPrimDesc({{LayoutType::ncsp, dataPrecision}, {LayoutType::ncsp, ov::element::i32}, {LayoutType::ncsp, ov::element::i32, isAxisInputConst}}, - {{LayoutType::ncsp, dataPrecision}}, + {{LayoutType::ncsp, canOptimizeCompressedEmbedding ? ov::element::f32 : dataPrecision}}, ref_any); // Let's check for the special inPlace memory use case @@ -273,6 +287,10 @@ void Gather::prepareParams() { if (getSelectedPrimitiveDescriptor() == nullptr) THROW_ERROR(" has unidentified preferable primitive descriptor."); + if (canOptimizeCompressedEmbedding) { + return; + } + // short 1D vector fast execution impl (typical in shape infer subgraph) canOptimize1DCase = false; if (dataSrcRank <= 1 && dataMemPtr->getDesc().getPrecision() == ov::element::i32) { @@ -335,10 +353,16 @@ void Gather::execute(dnnl::stream strm) { return; } + if (canOptimizeCompressedEmbedding) { + execCompressedCase(); + return; + } + if (canOptimize1DCase) { exec1DCase(); return; } + #if defined(OPENVINO_ARCH_X86_64) if (jitKernel && jitKernel->isSupportedConfiguration(afterAxisSize)) { const void* srcIndices = getSrcDataAtPort(GATHER_INDICES); @@ -402,6 +426,10 @@ void Gather::executeDynamicImpl(dnnl::stream strm) { exec1DCase(); return; } + if (canOptimizeCompressedEmbedding) { + execCompressedCase(); + return; + } #if defined(OPENVINO_ARCH_X86_64) if (jitKernel && jitKernel->isSupportedConfiguration(afterAxisSize)) { const void* srcIndices = getSrcDataAtPort(GATHER_INDICES); @@ -585,6 +613,46 @@ void Gather::exec1DCase() { } } +void Gather::execCompressedCase() { + DEBUG_LOG(getName(), " execCompressedCase"); + auto srcMemPtr = getParentEdgeAt(GATHER_DATA)->getMemoryPtr(); + auto idxMemPtr = getParentEdgeAt(GATHER_INDICES)->getMemoryPtr(); + + const auto* psrc = srcMemPtr->getDataAs(); + const auto* pidx = idxMemPtr->getDataAs(); + + const auto* zp = decompressionSubtractPtr->getDataAs(); + const auto* scale = decompressionMultiplyPtr->getDataAs(); + + auto* pdst = getDstDataAtPortAs(0); + + const auto& idxDims = idxMemPtr->getStaticDims(); + const auto batch = idxDims[0]; + const auto seqLen = idxDims[1]; + + auto axisDim = srcMemPtr->getStaticDims()[0]; + auto feaDim = srcMemPtr->getStaticDims()[1]; + + parallel_for2d(batch, seqLen, [&](size_t b, size_t s) { + auto dstIdx = b * seqLen + s; + auto ii = pidx[dstIdx]; + if (ii < 0) { + if (reverseIndexing) + ii += axisDim; + else + ii = axisDim; + } + + auto* src = psrc + ii * feaDim; + auto* dst = pdst + dstIdx * feaDim; + auto& deq_zp = zp[ii]; + auto& deq_scale = scale[ii]; + for (size_t k = 0; k < feaDim; k++) { + dst[k] = (static_cast(src[k]) - deq_zp) * deq_scale; + } + }); +} + bool Gather::created() const { return getType() == Type::Gather; } @@ -629,6 +697,30 @@ void Gather::resolveInPlaceEdges(Edge::LOOK look) { } } +void Gather::fuseDecompressionMultiply(const MemoryCPtr& memory) { + fuseDecompressionConstant(memory, decompressionMultiplyPtr); +} + +void Gather::fuseDecompressionSubtract(const MemoryCPtr& memory) { + fuseDecompressionConstant(memory, decompressionSubtractPtr); +} + +void Gather::fuseDecompressionConstant(const MemoryCPtr& memory, MemoryCPtr& decompressionValuesPtr) { + const auto decompression_prc = ov::element::f32; + if (memory->getDesc().getPrecision() == decompression_prc) { + decompressionValuesPtr = memory; + } else { + DnnlBlockedMemoryDesc memoryDesc(decompression_prc, memory->getShape()); + decompressionValuesPtr = std::make_shared(getEngine(), memoryDesc, nullptr, false); + const auto elementsCount = memory->getDescWithType()->getPaddedElementsCount(); + cpu_convert(memory->getData(), + decompressionValuesPtr->getData(), + DnnlExtensionUtils::DataTypeToElementType(memory->getDataType()), + ov::element::f32, + elementsCount); + } +} + } // namespace node } // namespace intel_cpu } // namespace ov diff --git a/src/plugins/intel_cpu/src/nodes/gather.h b/src/plugins/intel_cpu/src/nodes/gather.h index 87f4f3a09ce5be..5e6b6c999585ff 100644 --- a/src/plugins/intel_cpu/src/nodes/gather.h +++ b/src/plugins/intel_cpu/src/nodes/gather.h @@ -27,6 +27,9 @@ class Gather : public Node { bool isExecutable() const override; void resolveInPlaceEdges(Edge::LOOK look) override; + void fuseDecompressionMultiply(const MemoryCPtr& memory); + void fuseDecompressionSubtract(const MemoryCPtr& memory); + static bool isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept; struct threadExecParams { @@ -55,10 +58,14 @@ class Gather : public Node { private: void initShortParams(threadExecParams& p, uint64_t start); void execReference(); + void fuseDecompressionConstant(const MemoryCPtr& memory, MemoryCPtr& decompressionValuesPtr); bool canOptimize1DCase = false; void exec1DCase(); + bool canOptimizeCompressedEmbedding = false; + void execCompressedCase(); + bool isDataShapeStat = false; bool isIdxShapeStat = false; bool isAxisInputConst = false; @@ -91,6 +98,9 @@ class Gather : public Node { static constexpr size_t GATHER_AXIS = 2; std::shared_ptr jitKernel; + + MemoryCPtr decompressionSubtractPtr = nullptr; + MemoryCPtr decompressionMultiplyPtr = nullptr; }; } // namespace node diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.cpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.cpp index b427ce5f84dafe..7f12b67d54aae4 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.cpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.cpp @@ -10,6 +10,7 @@ #include #include "utils/general_utils.h" #include +#include "transformations/utils.hpp" #include "itt.hpp" @@ -401,6 +402,9 @@ bool isSuitableMatMulWithConstantPath(const std::shared_ptr& node) { !ov::is_type(node->get_input_node_shared_ptr(1)) && ov::op::util::is_on_constant_path(node->input_value(1)); } +bool isSuitableGatherWithConstantPath(const std::shared_ptr& node) { + return is_gather_with_compressed_weights(node); +} // Continue fusing chain of the passed type if the node has one child // Otherwise mark node as FusedTerminator (Fused, but fusing chain is interrupted) void PropagateIfHasOnlyChild(const std::shared_ptr &node, NodeFusingType nodeType) { @@ -477,7 +481,14 @@ bool SnippetsMarkSkipped::run_on_model(const std::shared_ptr &m) { }; std::unordered_set visited; ov::op::util::visit_constant_path(node->get_input_node_ptr(1), visited, markup_func); + } else if (isSuitableGatherWithConstantPath(node)) { + auto markup_func = [](Node* node) { + SetSnippetsNodeType(node->shared_from_this(), snippets::pass::SnippetsNodeType::SkippedByPlugin); + }; + std::unordered_set visited; + ov::op::util::visit_constant_path(node->get_input_node_ptr(0), visited, markup_func); } + if (isSuitableConvolutionParent(node)) { // Initiate fusing chain SetNodeFusingType(node, NodeFusingType::FusedWithConvolution); diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp index bd546f844dbfdd..51f5623d4e749f 100644 --- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp +++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp @@ -85,6 +85,7 @@ #include "transformations/init_node_info.hpp" #include "utils/ngraph_transformation.hpp" #include "utils/print_model.hpp" +#include "transformations/utils.hpp" // LPT transformations #include "low_precision/add.hpp" @@ -160,8 +161,13 @@ bool Transformations::is_decompression_multiply(const_node_ptr& node) const { } if (consumer != nullptr && ov::is_type(consumer)) { consumer = get_single_consumer(consumer); - if (consumer != nullptr && ov::is_type(consumer)) { - return true; + if (consumer != nullptr) { + if (ov::is_type(consumer)) { + return true; + } + if (is_gather_with_compressed_weights(consumer)) { + return true; + } } } return false; diff --git a/src/plugins/intel_cpu/src/transformations/utils.cpp b/src/plugins/intel_cpu/src/transformations/utils.cpp index f1943027917e8c..cd9da617108644 100644 --- a/src/plugins/intel_cpu/src/transformations/utils.cpp +++ b/src/plugins/intel_cpu/src/transformations/utils.cpp @@ -40,5 +40,89 @@ bool has_matmul_with_compressed_weights(const std::shared_ptr& return false; } +// Check specific pattern: +// Constant +// | +// Convert Constant +// \ / +// Subtract Constant +// \ / +// Multiply +// | +// Convert input Constant +// \ / / +// \ / / +// Gather +bool is_gather_with_compressed_weights(const std::shared_ptr& node) { + if (!ov::is_type(node)) { + return false; + } + if (node->get_input_size() != 3) { + return false; + } + + auto is_constant_with_2d = [](const ov::Node* node) { + const ov::Node* const_node = ov::is_type(node) ? node->get_input_node_ptr(0) : node; + + if (ov::is_type(const_node) && const_node->get_input_size() == 0) { + auto cur_shape = const_node->get_output_shape(0); + if (cur_shape.size() == 2 && cur_shape[1] == 1u) { + return true; + } + } + return false; + }; + + // Check axis + auto axis = node->get_input_node_ptr(2); + auto axisPtr = ov::as_type(axis); + if (!axisPtr) { + return false; + } + int32_t axis_const = axisPtr->cast_vector()[0]; + if (axis_const != 0) { + return false; + } + + // Check weights + ov::Node* multiply = nullptr; + auto multiply_convert = node->get_input_node_ptr(0); + if (ov::is_type(multiply_convert)) { + multiply = multiply_convert->get_input_node_ptr(0); + } else { + multiply = node->get_input_node_ptr(0); + } + if (!ov::is_type(multiply)) { + return false; + } + if (!is_constant_with_2d(multiply->get_input_node_ptr(1))) { + return false; + } + + auto subtract = multiply->get_input_node_ptr(0); + if (!ov::is_type(subtract)) { + return false; + } + if (!is_constant_with_2d(subtract->get_input_node_ptr(1))) { + return false; + } + + auto weights_convert = subtract->get_input_node_ptr(0); + if (!ov::is_type(weights_convert)) { + return false; + } + + auto weights = weights_convert->get_input_node_ptr(0); + auto weights_ptr = ov::as_type(weights); + if (!weights_ptr) { + return false; + } + auto weights_shape = weights_ptr->get_output_shape(0); + if (weights_shape.size() != 2u) { + return false; + } + return true; +} + } // namespace intel_cpu } // namespace ov diff --git a/src/plugins/intel_cpu/src/transformations/utils.hpp b/src/plugins/intel_cpu/src/transformations/utils.hpp index 64ebca6dfa5ed9..fabc95abf1525c 100644 --- a/src/plugins/intel_cpu/src/transformations/utils.hpp +++ b/src/plugins/intel_cpu/src/transformations/utils.hpp @@ -11,5 +11,7 @@ namespace intel_cpu { bool has_matmul_with_compressed_weights(const std::shared_ptr& model); +bool is_gather_with_compressed_weights(const std::shared_ptr& node); + } // namespace intel_cpu } // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.hpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.hpp index 263d3b4914d0b5..7b8e4ba3385233 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.hpp @@ -25,7 +25,7 @@ typedef std::tuple< ElementType, // Input precision ElementType, // Output precision InputShape, // Input shape - LayerTestsUtils::TargetDevice // Device name + ov::test::TargetDevice // Device name > convLayerTestParamsSet; typedef std::tuple< diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_offsets_sum.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_offsets_sum.cpp index 7248e95d5a8225..2b3dc2dd3398b3 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_offsets_sum.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_offsets_sum.cpp @@ -23,7 +23,7 @@ typedef std::tuple + ov::test::TargetDevice> embeddingBagOffsetsSumLayerTestParamsSet; class EmbeddingBagOffsetsSumLayerCPUTest : public testing::WithParamInterface, diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_packed_sum.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_packed_sum.cpp index d93dcf877054b8..f976441d6351b3 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_packed_sum.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_bag_packed_sum.cpp @@ -20,7 +20,7 @@ typedef std::tuple + ov::test::TargetDevice> embeddingBagPackedSumLayerTestParamsSet; class EmbeddingBagPackedSumLayerCPUTest : public testing::WithParamInterface, diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_segments_sum.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_segments_sum.cpp index ada1ffe8a9ca95..50b57b7a6dd822 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_segments_sum.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/embedding_segments_sum.cpp @@ -24,7 +24,7 @@ typedef std::tuple + ov::test::TargetDevice> embeddingSegmentsSumLayerTestParamsSet; class EmbeddingSegmentsSumLayerCPUTest : public testing::WithParamInterface, diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/range.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/range.cpp index 4bcd8f55c35b5b..985456e52fdaeb 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/range.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/range.cpp @@ -19,7 +19,7 @@ // typedef std::tuple< // RangeSpecificParams, // InferenceEngine::Precision, // Net precision -// LayerTestsUtils::TargetDevice // Device name +// ov::test::TargetDevice // Device name //> RangeLayerTestParams; // // typedef std::tuple< diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp index 8f2bcb583782e7..8d67ee0724ceb2 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/roi_pooling.cpp @@ -23,7 +23,7 @@ using roiPoolingParams = std::tuple; // Device name + ov::test::TargetDevice>; // Device name using ROIPoolingCPUTestParamsSet = std::tuple; using ROIAlignLayerCPUTestParamsSet = std::tuple< diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp index f070cbca71604d..bb12b5de29b23d 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp @@ -52,7 +52,9 @@ class ConcatConstantInPlaceTest : public testing::WithParamInterface weightValuesFP32(12); ov::Shape convFilterShape = {1, 12, 1, 1}; - FuncTestUtils::fillInputsBySinValues(weightValuesFP32.data(), weightValuesFP32.size()); + for (size_t i = 0; i < weightValuesFP32.size(); i++) { + weightValuesFP32.data()[i] = sin(static_cast(i)); + } auto weightsNode = std::make_shared(ov::element::f32, convFilterShape, weightValuesFP32); std::shared_ptr conv = std::make_shared(concat, weightsNode, diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/gather_weights_decompression.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/gather_weights_decompression.cpp new file mode 100644 index 00000000000000..eb3f52ddecc6e2 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/gather_weights_decompression.cpp @@ -0,0 +1,202 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/node_builders/constant.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" +#include "utils/fusing_test_utils.hpp" +#include "transformations/rt_info/decompression.hpp" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { + +/* + * WP - weights precision + * DP - decompression precision + * IP - input precision + * OP - output precision + * + * Weights(WP) Subtract_const(WP) + * | / + * Convert(DP) Convert(DP) + * \ / + * Subtract(DP) + * \ Multiply_const(DP) + * \ / + * Multiply + * / + * Data(IP) Convert(OP) + * \ / + * Gather(OP) Weights(OP) + * \ / + * MatMul(OP) (Add MatMul in order to test OP==bf16 in SPR) + */ + +struct InputAndWeigthsShapeParams { + InputAndWeigthsShapeParams() = default; + InputAndWeigthsShapeParams(InputShape _data_shape, ov::Shape _weights_shape) + : data_shape(std::move(_data_shape)), + weights_shape(std::move(_weights_shape)) {} + + InputShape data_shape; + ov::Shape weights_shape; +}; + +using GatherWeightsDecompressParams = std::tuple; // should use decompression implementation + +class GatherWeightsDecompression : public testing::WithParamInterface, + virtual public SubgraphBaseTest, + public CpuTestWithFusing { +public: + static std::string getTestCaseName(testing::TestParamInfo obj) { + InputAndWeigthsShapeParams shape_params; + ov::AnyMap additional_config; + fusingSpecificParams fusing_params; + bool should_fuse; + + std::tie(shape_params, additional_config, fusing_params, should_fuse) = obj.param; + + std::ostringstream result; + result << "data_shape=" << shape_params.data_shape << "_"; + result << "weights_shape=" << shape_params.weights_shape << "_"; + + result << "config=("; + for (const auto& configEntry : additional_config) { + result << configEntry.first << ", " << configEntry.second.as() << ":"; + } + result << ")"; + result << CpuTestWithFusing::getTestCaseName(fusing_params); + + return result.str(); + } + +protected: + std::shared_ptr initDecompressionWeights(const ov::Shape& weights_shape, + const ov::element::Type weights_precision) { + auto weights = ov::test::utils::make_constant(weights_precision, + weights_shape, + ov::test::utils::InputGenerateData{0, 255}); + weights->set_friendly_name("Compressed_weights"); + auto weights_convert = std::make_shared(weights, ov::element::f16); + + std::shared_ptr zp_const = ov::test::utils::make_constant(ov::element::u8, + ov::Shape{weights_shape[0], 1}, + ov::test::utils::InputGenerateData{}); + auto zp_convert = std::make_shared(zp_const, ov::element::f16); + + std::shared_ptr scale_const = + ov::test::utils::make_constant(ov::element::f16, + ov::Shape{weights_shape[0], 1}, + ov::test::utils::InputGenerateData{}); + auto subtract = std::make_shared(weights_convert, zp_convert); + auto multiply = std::make_shared(subtract, scale_const); + auto last_node = std::make_shared(multiply, ov::element::f32); + return last_node; + } + + std::shared_ptr initSubgraph(const ov::PartialShape& data_shape, + const ov::Shape& weights_shape, + const ov::element::Type data_precision) { + ov::ParameterVector params{std::make_shared(ov::element::i64, data_shape)}; + auto params_convert = std::make_shared(params[0], ov::element::i32); + auto axis = ov::op::v0::Constant::create(element::i32, Shape{1}, {0}); + + const auto weights_subgraph = initDecompressionWeights(weights_shape, + ov::element::u8); + + auto gather = std::make_shared(weights_subgraph, params_convert, axis); + gather->set_friendly_name("GatherCompression"); + + auto matB = ov::op::v0::Constant::create(element::f32, Shape{weights_shape[1], 1}, {1}); + auto matMul = std::make_shared(gather, matB, false, false); + return makeNgraphFunction(data_precision, params, matMul, "GatherWeightsDecompression"); + } + + void SetUp() override { + targetDevice = ov::test::utils::DEVICE_CPU; + + InputAndWeigthsShapeParams shape_params; + ov::AnyMap additional_config; + fusingSpecificParams fusing_params; + bool should_fuse; + + std::tie(shape_params, additional_config, fusing_params, should_fuse) = GetParam(); + + configuration.insert(additional_config.begin(), additional_config.end()); + std::tie(postOpMgrPtr, fusedOps) = fusing_params; + init_input_shapes({shape_params.data_shape, {{}, {{shape_params.weights_shape}}}}); + + ElementType netType = ov::element::f32; + inType = outType = netType; + + function = initSubgraph(inputDynamicShapes[0], shape_params.weights_shape, netType); + } + + void check_results() { + bool weights_found = false; + for (const auto& n : compiledModel.get_runtime_model()->get_ordered_ops()) { + if (n->get_friendly_name() == "Compressed_weights") { + ASSERT_EQ(n->get_output_element_type(0), ov::element::u8); + weights_found = true; + } + } + ASSERT_TRUE(weights_found); + + bool gather_found = false; + for (const auto& n : compiledModel.get_runtime_model()->get_ordered_ops()) { + if (n->get_friendly_name() == "GatherCompression") { + ASSERT_EQ(n->get_input_element_type(0), ov::element::u8); + ASSERT_EQ(n->get_output_element_type(0), ov::element::f32); + gather_found = true; + } + } + ASSERT_TRUE(gather_found); + + CheckNumberOfNodesWithType(compiledModel, "Convert", 1); + CheckNumberOfNodesWithType(compiledModel, "Subtract", 0); + CheckNumberOfNodesWithType(compiledModel, "Multiply", 0); + CheckNumberOfNodesWithType(compiledModel, "Subgraph", 0); + } +}; + +TEST_P(GatherWeightsDecompression, CompareWithRefs) { + SKIP_IF_CURRENT_TEST_IS_DISABLED() + run(); + check_results(); +} + +namespace { + +std::vector filter_additional_config() { + std::vector additional_config = {}; + additional_config.push_back({{ov::hint::inference_precision(ov::element::f32)}}); + if (ov::with_cpu_x86_bfloat16()) { + additional_config.push_back({{ov::hint::inference_precision(ov::element::bf16)}}); + } + + return additional_config; +} + +const std::vector input_weights_shapes = { + {{{-1, -1}, {{1, 1}}}, {16, 32}}, + {{{-1, -1}, {{1, 8}}}, {16, 64}}, + {{{}, {{2, 1}}}, {16, 33}} +}; + +const std::vector fs_params{emptyFusingSpec, fusingBias}; + +INSTANTIATE_TEST_SUITE_P(smoke_GatherCompressedWeights_basic, + GatherWeightsDecompression, + ::testing::Combine(::testing::ValuesIn(input_weights_shapes), + ::testing::ValuesIn(filter_additional_config()), + ::testing::ValuesIn(fs_params), + ::testing::Values(true)), + GatherWeightsDecompression::getTestCaseName); +} // namespace +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/disable_lowering_precision.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/disable_lowering_precision.cpp index f31fe30ce39941..70a00425bfa5a9 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/disable_lowering_precision.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/disable_lowering_precision.cpp @@ -9,7 +9,6 @@ #include "openvino/runtime/system_conf.hpp" using namespace ExecutionGraphTests; -using namespace InferenceEngine; namespace { diff --git a/src/plugins/template/tests/functional/subgraph_reference/base_reference_cnn_test.cpp b/src/plugins/template/tests/functional/subgraph_reference/base_reference_cnn_test.cpp deleted file mode 100644 index abdf47a4b8c3b0..00000000000000 --- a/src/plugins/template/tests/functional/subgraph_reference/base_reference_cnn_test.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// -#include "base_reference_cnn_test.hpp" - -#include - -#include "functional_test_utils/ov_plugin_cache.hpp" -#include "openvino/core/type/element_type.hpp" -#include "openvino/runtime/allocator.hpp" -#include "openvino/runtime/tensor.hpp" -#include "shared_test_classes/base/layer_test_utils.hpp" -#include "transformations/utils/utils.hpp" - -using namespace ov; - -namespace reference_tests { - -ReferenceCNNTest::ReferenceCNNTest() : targetDevice("TEMPLATE") { - core = test::utils::PluginCache::get().core(targetDevice); - legacy_core = PluginCache::get().ie(targetDevice); -} - -void ReferenceCNNTest::Exec() { - LoadNetwork(); - LoadNetworkLegacy(); - - if (legacy_input_blobs.empty() && inputData.empty()) { - FillInputs(); - } - Infer(); - InferLegacy(); - - Validate(); -} - -void ReferenceCNNTest::LoadNetwork() { - executableNetwork = core->compile_model(function, targetDevice); -} - -void ReferenceCNNTest::LoadNetworkLegacy() { - auto inputInfo = legacy_network.getInputsInfo(); - auto outputInfo = legacy_network.getOutputsInfo(); - for (const auto& param : function->get_parameters()) { - inputInfo[param->get_friendly_name()]->setPrecision( - InferenceEngine::details::convertPrecision(param->get_element_type())); - } - for (const auto& result : function->get_results()) { - outputInfo[ov::op::util::create_ie_output_name(result->input_value(0))]->setPrecision( - InferenceEngine::details::convertPrecision(result->get_element_type())); - } - legacy_exec_network = legacy_core->LoadNetwork(legacy_network, targetDevice); -} - -void ReferenceCNNTest::FillInputs() { - const auto& params = function->get_parameters(); - std::default_random_engine random(0); // hard-coded seed to make test results predictable - std::uniform_int_distribution distrib(0, 255); - for (const auto& param : params) { - auto elem_count = shape_size(param->get_output_tensor(0).get_shape()); - InferenceEngine::TensorDesc d(InferenceEngine::Precision::FP32, - param->get_output_tensor(0).get_shape(), - InferenceEngine::Layout::NCHW); - auto blob = make_blob_with_precision(d); - blob->allocate(); - - auto mBlob = InferenceEngine::as(blob); - auto mBlobHolder = mBlob->wmap(); - auto buf = mBlobHolder.as(); - ASSERT_EQ(mBlob->size(), elem_count); - - ov::Tensor ov_blob; - ov_blob = ov::Tensor(param->get_element_type(), param->get_shape()); - auto ov_buf = static_cast(ov_blob.data()); - - for (size_t j = 0; j < elem_count; j++) { - auto v = distrib(random); - buf[j] = static_cast(v); - ov_buf[j] = static_cast(v); - } - legacy_input_blobs[param->get_friendly_name()] = blob; - inputData.push_back(ov_blob); - } -} - -void ReferenceCNNTest::Infer() { - inferRequest = executableNetwork.create_infer_request(); - const auto& functionParams = function->get_parameters(); - - for (size_t i = 0; i < functionParams.size(); ++i) { - const auto& param = functionParams[i]; - inferRequest.set_tensor(param->get_friendly_name(), inputData[i]); - } - inferRequest.infer(); -} - -void ReferenceCNNTest::InferLegacy() { - legacy_infer_request = legacy_exec_network.CreateInferRequest(); - legacy_infer_request.SetInput(legacy_input_blobs); - legacy_infer_request.Infer(); -} - -void ReferenceCNNTest::Validate() { - for (const auto& result : function->get_results()) { - auto name = ov::op::util::create_ie_output_name(result->input_value(0)); - outputs_ov20.emplace_back(inferRequest.get_tensor(name)); - auto outBlob = legacy_infer_request.GetBlob(name); - auto outMem = outBlob->buffer(); - void* outData = outMem.as(); - outputs_legacy.emplace_back(element::f32, result->get_shape(), outData); - } - for (size_t i = 0; i < outputs_legacy.size(); i++) { - CommonReferenceTest::ValidateBlobs(outputs_legacy[i], outputs_ov20[i], i, threshold, abs_threshold); - } -} - -} // namespace reference_tests diff --git a/src/plugins/template/tests/functional/subgraph_reference/base_reference_cnn_test.hpp b/src/plugins/template/tests/functional/subgraph_reference/base_reference_cnn_test.hpp deleted file mode 100644 index 4dcb27ee2c2dc4..00000000000000 --- a/src/plugins/template/tests/functional/subgraph_reference/base_reference_cnn_test.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include "base_reference_test.hpp" -#include "inference_engine.hpp" - -namespace reference_tests { - -class ReferenceCNNTest { -public: - ReferenceCNNTest(); - - void Exec(); - - void LoadNetwork(); - void FillInputs(); // Both for legacy and for OV2.0 API - void Infer(); - - void LoadNetworkLegacy(); - void InferLegacy(); - - virtual void Validate(); - -protected: - const std::string targetDevice; - std::shared_ptr function; - InferenceEngine::CNNNetwork legacy_network; - - float threshold = 1e-5f; // Relative diff - float abs_threshold = -1.f; // Absolute diff (not used when negative) - - std::vector outputs_ov20; - std::vector outputs_legacy; - -protected: - // These will be generated by default, if user has not specified inputs manually - std::vector inputData; - InferenceEngine::BlobMap legacy_input_blobs; - -private: - std::shared_ptr core; - ov::CompiledModel executableNetwork; - ov::InferRequest inferRequest; - - std::shared_ptr legacy_core; - InferenceEngine::ExecutableNetwork legacy_exec_network; - InferenceEngine::InferRequest legacy_infer_request; -}; - -} // namespace reference_tests diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/benchmark.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/benchmark.hpp index cd0e1375eda074..15d89175ea5382 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/benchmark.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/benchmark.hpp @@ -63,139 +63,6 @@ class BenchmarkLayerTestReporter { pugi::xml_document report_xml_{}; }; -} // namespace test -} // namespace ov - -namespace LayerTestsDefinitions { - -template -class BenchmarkLayerTest : public BaseLayerTest { - static_assert(std::is_base_of::value, - "BaseLayerTest should inherit from LayerTestsUtils::LayerTestsCommon"); - -public: - static constexpr int kDefaultNumberOfAttempts = 100; - static constexpr double kMaxAllowedBenchmarkDifference = 0.05; - - void RunBenchmark(const std::initializer_list& nodeTypeNames, - const std::chrono::milliseconds warmupTime = std::chrono::milliseconds(2000), - const int numAttempts = kDefaultNumberOfAttempts) { - bench_node_type_names_ = nodeTypeNames; - warmup_time_ = warmupTime; - num_attempts_ = numAttempts; - this->configuration.insert({"PERF_COUNT", "YES"}); - this->Run(); - } - - void RunBenchmark(const std::string& nodeTypeName, - const std::chrono::milliseconds warmupTime = std::chrono::milliseconds(2000), - const int numAttempts = kDefaultNumberOfAttempts) { - if (!nodeTypeName.empty()) { - RunBenchmark({nodeTypeName}, warmupTime, numAttempts); - } else { - RunBenchmark({}, warmupTime, numAttempts); - } - } - - void Validate() override { - for (const auto& res : curr_bench_results_) { - const auto& node_type_name = res.first; - const auto curr_time = static_cast(res.second); - if (prev_bench_results_.count(node_type_name) > 0) { - const auto prev_time = static_cast(prev_bench_results_[node_type_name]); - const auto delta_time = static_cast(curr_time - prev_time); - if (delta_time/prev_time > kMaxAllowedBenchmarkDifference) { - std::cerr << "node_type_name: " << node_type_name << - ", for test case: " << BaseLayerTest::GetTestName() << - ", has exceeded the benchmark threshold: " << kMaxAllowedBenchmarkDifference << - ". Current: " << curr_time << " us, previous: " << prev_time << " us" << std::endl; - } - } - } - } - -protected: - void Infer() override { - this->inferRequest = this->executableNetwork.CreateInferRequest(); - this->ConfigureInferRequest(); - -#ifdef ENABLE_BENCHMARK_FILE_REPORT - reporter_ = std::unique_ptr( - new ::ov::test::BenchmarkLayerTestReporter{false}); -#else - reporter_ = std::unique_ptr( - new ::ov::test::BenchmarkLayerTestReporter{true}); -#endif - for (const auto& node_type_name : bench_node_type_names_) { - try { - const auto time = reporter_->get_time(node_type_name, BaseLayerTest::GetTestName()); - prev_bench_results_[node_type_name] = time; - } catch (...) { - } - } - - std::map results_us{}; - for (const auto& node_type_name : bench_node_type_names_) { - results_us[node_type_name] = {}; - } - - // Warmup - auto warm_current = std::chrono::steady_clock::now(); - const auto warm_end = warm_current + warmup_time_; - while (warm_current < warm_end) { - this->inferRequest.Infer(); - warm_current = std::chrono::steady_clock::now(); - } - - // Benchmark - for (size_t i = 0; i < num_attempts_; ++i) { - this->inferRequest.Infer(); - const auto& perf_results = this->inferRequest.GetPerformanceCounts(); - for (auto& res : results_us) { - const std::string node_type_name = res.first; - uint64_t& time = res.second; - auto found_profile = std::find_if(perf_results.begin(), perf_results.end(), - [&node_type_name](const InferenceEngine::InferenceEngineProfileInfo& profile) { - return profile.layer_type == node_type_name; - }); - if (found_profile == perf_results.end()) { - IE_THROW() << "Cannot find operator by node type: " << node_type_name; - } - time += found_profile->second.realTime_uSec; - } - } - - std::stringstream report{}; - uint64_t total_us = 0; - for (const auto& res : results_us) { - const std::string node_type_name = res.first; - uint64_t time = res.second; - time /= num_attempts_; - total_us += time; - report << std::fixed << std::setfill('0') << node_type_name << ": " << time << " us\n"; -#ifdef ENABLE_BENCHMARK_FILE_REPORT - curr_bench_results_[node_type_name] = time; - reporter_->report(node_type_name, BaseLayerTest::GetTestName(), time); -#endif - } - report << std::fixed << std::setfill('0') << "Total time: " << total_us << " us\n"; - std::cout << report.str(); - } - -private: - std::unique_ptr reporter_; - std::unordered_map prev_bench_results_; - std::unordered_map curr_bench_results_; - std::vector bench_node_type_names_; - std::chrono::milliseconds warmup_time_; - int num_attempts_; -}; - -} // namespace LayerTestsDefinitions - -namespace ov { -namespace test { - template class BenchmarkLayerTest : public BaseLayerTest { static_assert(std::is_base_of::value, diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp index 26e5d834a62d2a..a23e1be0e84943 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp @@ -5,14 +5,12 @@ #pragma once #include -#include #include "common_test_utils/common_utils.hpp" #include "common_test_utils/ov_test_utils.hpp" #include "common_test_utils/test_common.hpp" -#include "functional_test_utils/blob_utils.hpp" +#include "common_test_utils/data_utils.hpp" #include "functional_test_utils/crash_handler.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "functional_test_utils/skip_tests_config.hpp" #include "functional_test_utils/summary/environment.hpp" #include "functional_test_utils/summary/op_summary.hpp" @@ -24,126 +22,9 @@ namespace LayerTestsUtils { using TargetDevice = std::string; -typedef std::tuple< - InferenceEngine::Precision, // Network Precision - InferenceEngine::SizeVector, // Input Shape - TargetDevice // Target Device -> basicParams; - -enum RefMode { - INTERPRETER, - CONSTANT_FOLDING, - IE -}; - -class LayerTestsCommon : public ov::test::TestsCommon { -public: - virtual InferenceEngine::Blob::Ptr GenerateInput(const InferenceEngine::InputInfo &inputInfo) const; - - virtual void Run(); - - static void Compare(const std::vector>> &expected, - const std::vector &actual, - float threshold, - float abs_threshold = -1.f); - - static void Compare(const std::pair> &expected, - const InferenceEngine::Blob::Ptr &actual, - float threshold, - float abs_threshold = -1.f); - - virtual void Compare(const std::vector>> &expectedOutputs, - const std::vector &actualOutputs); - - virtual void Compare(const std::pair> &expected, const InferenceEngine::Blob::Ptr &actual); - - virtual void Compare(const InferenceEngine::Blob::Ptr &expected, const InferenceEngine::Blob::Ptr &actual); - - virtual void Compare(const InferenceEngine::TensorDesc &actualDesc, const InferenceEngine::TensorDesc &expectedDesc); - - std::shared_ptr GetFunction(); - - std::map& GetConfiguration(); - - template - static void Compare(const T_NGRAPH *expected, const T_IE *actual, std::size_t size, float threshold, float abs_threshold = -1.f) { - for (std::size_t i = 0; i < size; ++i) { - const T_NGRAPH &ref = expected[i]; - const auto &res = actual[i]; - const auto absoluteDifference = ov::test::utils::ie_abs(res - ref); - if (abs_threshold > 0.f && absoluteDifference > abs_threshold) { - IE_THROW() << "Absolute comparison of values expected: " << std::to_string(ref) << " and actual: " << std::to_string(res) - << " at index " << i << " with absolute threshold " << abs_threshold - << " failed"; - } - if (absoluteDifference <= threshold) { - continue; - } - double max; - if (sizeof(T_IE) < sizeof(T_NGRAPH)) { - max = static_cast(std::max(ov::test::utils::ie_abs(T_NGRAPH(res)), ov::test::utils::ie_abs(ref))); - } else { - max = static_cast(std::max(ov::test::utils::ie_abs(res), ov::test::utils::ie_abs(T_IE(ref)))); - } - double diff = static_cast(absoluteDifference) / max; - if (max == 0 || (diff > static_cast(threshold)) || - (std::isnan(static_cast(res)) ^ std::isnan(static_cast(ref)))) { - IE_THROW() << "Relative comparison of values expected: " << std::to_string(ref) << " and actual: " << std::to_string(res) - << " at index " << i << " with threshold " << threshold - << " failed"; - } - } - } - +class LayerTestsCommon { protected: LayerTestsCommon(); - - RefMode GetRefMode() { - return refMode; - } - - std::shared_ptr getCore() { - return core; - } - - virtual void ConfigureNetwork(); - - virtual void LoadNetwork(); - - virtual void ExpectLoadNetworkToThrow(const std::string& msg); - - virtual void GenerateInputs(); - - virtual void ConfigureInferRequest(); - - virtual void Infer(); - - TargetDevice targetDevice; - std::shared_ptr function; - std::shared_ptr functionRefs; - std::map configuration; - // Non default values of layouts/precisions will be set to CNNNetwork - InferenceEngine::Layout inLayout = InferenceEngine::Layout::ANY; - InferenceEngine::Layout outLayout = InferenceEngine::Layout::ANY; - InferenceEngine::Precision inPrc = InferenceEngine::Precision::UNSPECIFIED; - InferenceEngine::Precision outPrc = InferenceEngine::Precision::UNSPECIFIED; - InferenceEngine::ExecutableNetwork executableNetwork; - std::vector inputs; - float threshold; - float abs_threshold; - InferenceEngine::CNNNetwork cnnNetwork; - std::shared_ptr core; - - virtual void Validate(); - - virtual std::vector>> CalculateRefs(); - - virtual std::vector GetOutputs(); - - InferenceEngine::InferRequest inferRequest; - -private: - RefMode refMode = RefMode::INTERPRETER; }; } // namespace LayerTestsUtils diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/scaleshift.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/scaleshift.hpp index ac72c943319c2a..3c0a23c74d2bde 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/scaleshift.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/scaleshift.hpp @@ -32,23 +32,3 @@ class ScaleShiftLayerTest: }; } // namespace test } // namespace ov - -// legacy impl for npu repo -namespace SubgraphTestsDefinitions { - -using ScaleShiftParamsTuple = typename std::tuple< - std::vector>, //input shapes - InferenceEngine::Precision, //Network precision - std::string, //Device name - std::vector, //scale - std::vector>; //shift - -class ScaleShiftLayerTest: - public testing::WithParamInterface, - virtual public LayerTestsUtils::LayerTestsCommon{ -public: - static std::string getTestCaseName(const testing::TestParamInfo &obj); -protected: - void SetUp() override; -}; -} // namespace SubgraphTestsDefinitions diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_conv_concat.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_conv_concat.hpp index d74865a6bb0c6b..a08870dfb68006 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_conv_concat.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/subgraph/split_conv_concat.hpp @@ -30,16 +30,3 @@ class SplitConvConcat : public testing::WithParamInterface, - virtual public ov::test::SplitConvConcatBase { -public: - static std::string getTestCaseName(const testing::TestParamInfo& obj); - -protected: - void SetUp() override; -}; - -} // namespace SubgraphTestsDefinitions diff --git a/src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp b/src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp deleted file mode 100644 index b5e9395d1c5619..00000000000000 --- a/src/tests/functional/shared_test_classes/src/base/layer_test_utils.cpp +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#ifdef _WIN32 -#include -#endif - -#include - -#include "common_test_utils/file_utils.hpp" -#include "ie_icore.hpp" -#include "openvino/opsets/opset.hpp" -#include "openvino/pass/serialize.hpp" -#include "openvino/runtime/device_id_parser.hpp" -#include "shared_test_classes/base/layer_test_utils.hpp" - -namespace LayerTestsUtils { - -LayerTestsCommon::LayerTestsCommon() : threshold(1e-2f), abs_threshold(-1.f) { - core = PluginCache::get().ie(targetDevice); -} - -void LayerTestsCommon::Run() { - bool isCurrentTestDisabled = ov::test::utils::current_test_is_disabled(); - - ov::test::utils::PassRate::Statuses status = isCurrentTestDisabled ? - ov::test::utils::PassRate::Statuses::SKIPPED : - ov::test::utils::PassRate::Statuses::CRASHED; - - auto &s = ov::test::utils::OpSummary::getInstance(); - s.setDeviceName(targetDevice); - s.updateOPsStats(function, status); - - if (isCurrentTestDisabled) - GTEST_SKIP() << "Disabled test due to configuration" << std::endl; - - if (functionRefs == nullptr) { - functionRefs = function->clone(); - functionRefs->set_friendly_name("refFunction"); - } - - // in case of crash jump will be made and work will be continued - auto crashHandler = std::unique_ptr(new ov::test::utils::CrashHandler()); - - // place to jump in case of a crash - int jmpRes = 0; -#ifdef _WIN32 - jmpRes = setjmp(ov::test::utils::env); -#else - jmpRes = sigsetjmp(ov::test::utils::env, 1); -#endif - if (jmpRes == ov::test::utils::JMP_STATUS::ok) { - crashHandler->StartTimer(); - try { - LoadNetwork(); - GenerateInputs(); - Infer(); - Validate(); - s.updateOPsStats(functionRefs, ov::test::utils::PassRate::Statuses::PASSED); - } - catch (const std::runtime_error &re) { - s.updateOPsStats(functionRefs, ov::test::utils::PassRate::Statuses::FAILED); - GTEST_FATAL_FAILURE_(re.what()); - } catch (const std::exception &ex) { - s.updateOPsStats(functionRefs, ov::test::utils::PassRate::Statuses::FAILED); - GTEST_FATAL_FAILURE_(ex.what()); - } catch (...) { - s.updateOPsStats(functionRefs, ov::test::utils::PassRate::Statuses::FAILED); - GTEST_FATAL_FAILURE_("Unknown failure occurred."); - } - } else if (jmpRes == ov::test::utils::JMP_STATUS::anyError) { - IE_THROW() << "Crash happens"; - } else if (jmpRes == ov::test::utils::JMP_STATUS::alarmErr) { - s.updateOPsStats(functionRefs, ov::test::utils::PassRate::Statuses::HANGED); - IE_THROW() << "Crash happens"; - } -} - -InferenceEngine::Blob::Ptr LayerTestsCommon::GenerateInput(const InferenceEngine::InputInfo& info) const { - return FuncTestUtils::createAndFillBlob(info.getTensorDesc()); -} - -void LayerTestsCommon::Compare( - const std::vector>>& expectedOutputs, - const std::vector& actualOutputs, - float threshold, - float abs_threshold) { - for (std::size_t outputIndex = 0; outputIndex < expectedOutputs.size(); ++outputIndex) { - const auto &expected = expectedOutputs[outputIndex]; - const auto &actual = actualOutputs[outputIndex]; - Compare(expected, actual, threshold, abs_threshold); - } -} - -template -inline void callCompare(const std::pair>& expected, - const T_IE* actualBuffer, - size_t size, - float threshold, - float abs_threshold) { - auto expectedBuffer = expected.second.data(); - switch (expected.first) { - case ov::element::Type_t::boolean: - case ov::element::Type_t::u8: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::i8: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::u16: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::i16: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::u32: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::i32: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::u64: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::i64: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::bf16: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::f16: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::f32: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::f64: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - case ov::element::Type_t::i4: { - auto expectedOut = - ngraph::helpers::convertOutputPrecision(expected.second, expected.first, ov::element::Type_t::i8, size); - LayerTestsCommon::Compare(reinterpret_cast(expectedOut.data()), - actualBuffer, - size, - threshold, - abs_threshold); - break; - } - case ov::element::Type_t::u4: { - auto expectedOut = - ngraph::helpers::convertOutputPrecision(expected.second, expected.first, ov::element::Type_t::u8, size); - LayerTestsCommon::Compare(reinterpret_cast(expectedOut.data()), - actualBuffer, - size, - threshold, - abs_threshold); - break; - } - case ov::element::Type_t::dynamic: - case ov::element::Type_t::undefined: - LayerTestsCommon::Compare(reinterpret_cast(expectedBuffer), - actualBuffer, - size, - threshold, - abs_threshold); - break; - default: - FAIL() << "Comparator for " << expected.first << " precision isn't supported"; - } - return; -} - -void LayerTestsCommon::Compare(const std::pair>& expected, - const InferenceEngine::Blob::Ptr& actual, - float threshold, - float abs_threshold) { - const auto &precision = actual->getTensorDesc().getPrecision(); - auto k = static_cast(expected.first.size()) / precision.size(); - // W/A for int4, uint4 - if (expected.first == ov::element::Type_t::u4 || expected.first == ov::element::Type_t::i4) { - k /= 2; - } else if (expected.first == ov::element::Type_t::undefined || expected.first == ov::element::Type_t::dynamic) { - k = 1; - } - ASSERT_EQ(expected.second.size(), actual->byteSize() * k); - - auto memory = InferenceEngine::as(actual); - IE_ASSERT(memory); - const auto lockedMemory = memory->wmap(); - const auto actualBuffer = lockedMemory.as(); - - const auto &size = actual->size(); - switch (precision) { - case InferenceEngine::Precision::BOOL: - case InferenceEngine::Precision::U8: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::I8: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::U16: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::I16: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::U32: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::I32: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::U64: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::I64: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::BF16: - callCompare(expected, - reinterpret_cast(actualBuffer), - size, - threshold, - abs_threshold); - break; - case InferenceEngine::Precision::FP16: - callCompare(expected, - reinterpret_cast(actualBuffer), - size, - threshold, - abs_threshold); - break; - case InferenceEngine::Precision::FP32: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - case InferenceEngine::Precision::FP64: - callCompare(expected, reinterpret_cast(actualBuffer), size, threshold, abs_threshold); - break; - default: - FAIL() << "Comparator for " << precision << " precision isn't supported"; - } -} - -void LayerTestsCommon::Compare(const std::pair>& expected, - const InferenceEngine::Blob::Ptr& actual) { - Compare(expected, actual, threshold); -} - -void LayerTestsCommon::Compare(const InferenceEngine::Blob::Ptr &expected, const InferenceEngine::Blob::Ptr &actual) { - auto get_raw_buffer = [](const InferenceEngine::Blob::Ptr &blob) { - auto memory = InferenceEngine::as(blob); - IE_ASSERT(memory); - const auto lockedMemory = memory->wmap(); - return lockedMemory.as(); - }; - const auto expectedBuffer = get_raw_buffer(expected); - const auto actualBuffer = get_raw_buffer(actual); - - const auto &precision = actual->getTensorDesc().getPrecision(); - const auto &size = actual->size(); - switch (precision) { - case InferenceEngine::Precision::FP32: - Compare(reinterpret_cast(expectedBuffer), reinterpret_cast(actualBuffer), - size, threshold); - break; - case InferenceEngine::Precision::I32: - Compare(reinterpret_cast(expectedBuffer), - reinterpret_cast(actualBuffer), size, 0); - break; - case InferenceEngine::Precision::I16: - Compare(reinterpret_cast(expectedBuffer), - reinterpret_cast(actualBuffer), size, 0); - break; - case InferenceEngine::Precision::U8: - Compare(reinterpret_cast(expectedBuffer), - reinterpret_cast(actualBuffer), size, 0); - break; - default: - FAIL() << "Comparator for " << precision << " precision isn't supported"; - } -} - -void LayerTestsCommon::Compare(const InferenceEngine::TensorDesc &actualDesc, const InferenceEngine::TensorDesc &expectedDesc) { - auto expectedDims = actualDesc.getDims(); - auto actualDims = expectedDesc.getDims(); - ASSERT_EQ(actualDims.size(), expectedDims.size()); - for (size_t j = 0; j < actualDims.size(); ++j) { - ASSERT_EQ(actualDims.at(j), expectedDims.at(j)); - } - ASSERT_EQ(actualDesc.getLayout(), expectedDesc.getLayout()); - ASSERT_EQ(actualDesc.getPrecision(), expectedDesc.getPrecision()); -} - -void LayerTestsCommon::ConfigureNetwork() { - for (const auto &in : cnnNetwork.getInputsInfo()) { - if (inLayout != InferenceEngine::Layout::ANY) { - in.second->setLayout(inLayout); - } - if (inPrc != InferenceEngine::Precision::UNSPECIFIED) { - in.second->setPrecision(inPrc); - } - } - - for (const auto &out : cnnNetwork.getOutputsInfo()) { - if (outLayout != InferenceEngine::Layout::ANY) { - out.second->setLayout(outLayout); - } - if (outPrc != InferenceEngine::Precision::UNSPECIFIED) { - out.second->setPrecision(outPrc); - } - } -} - -void LayerTestsCommon::LoadNetwork() { - cnnNetwork = InferenceEngine::CNNNetwork{function}; - ConfigureNetwork(); - executableNetwork = core->LoadNetwork(cnnNetwork, targetDevice, configuration); -} - -void LayerTestsCommon::ExpectLoadNetworkToThrow(const std::string& msg) { - std::string what; - try { - LoadNetwork(); - } catch (const std::exception& e) { - what.assign(e.what()); - } - EXPECT_STR_CONTAINS(what.c_str(), msg.c_str()); -} - -void LayerTestsCommon::GenerateInputs() { - inputs.clear(); - const auto& inputsInfo = executableNetwork.GetInputsInfo(); - const auto& functionParams = function->get_parameters(); - for (int i = 0; i < functionParams.size(); ++i) { - const auto& param = functionParams[i]; - const auto infoIt = inputsInfo.find(param->get_friendly_name()); - GTEST_ASSERT_NE(infoIt, inputsInfo.cend()); - InferenceEngine::InputInfo::CPtr info = infoIt->second; - InferenceEngine::Blob::Ptr blob = GenerateInput(*info); - inputs.push_back(blob); - } -} - -void LayerTestsCommon::ConfigureInferRequest() { - const auto& inputsInfo = executableNetwork.GetInputsInfo(); - const auto& functionParams = function->get_parameters(); - for (int i = 0; i < functionParams.size(); ++i) { - const auto& param = functionParams[i]; - const auto infoIt = inputsInfo.find(param->get_friendly_name()); - GTEST_ASSERT_NE(infoIt, inputsInfo.cend()); - - const auto& info = infoIt->second; - auto blob = inputs[i]; - inferRequest.SetBlob(info->name(), blob); - } -} - -void LayerTestsCommon::Infer() { - inferRequest = executableNetwork.CreateInferRequest(); - - ConfigureInferRequest(); - - inferRequest.Infer(); -} - -std::vector>> LayerTestsCommon::CalculateRefs() { - return {}; -} - -std::vector LayerTestsCommon::GetOutputs() { - auto outputs = std::vector{}; - for (const auto &output : executableNetwork.GetOutputsInfo()) { - const auto &name = output.first; - outputs.push_back(inferRequest.GetBlob(name)); - } - return outputs; -} - -void LayerTestsCommon::Compare( - const std::vector>>& expectedOutputs, - const std::vector& actualOutputs) { - Compare(expectedOutputs, actualOutputs, threshold); -} - -void LayerTestsCommon::Validate() {} - -std::shared_ptr LayerTestsCommon::GetFunction() { - return function; -} - -std::map &LayerTestsCommon::GetConfiguration() { - return configuration; -} - -} // namespace LayerTestsUtils diff --git a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp index 6a982171cc6bcd..7514ab753ab100 100644 --- a/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp +++ b/src/tests/functional/shared_test_classes/src/base/utils/generate_inputs.cpp @@ -491,7 +491,6 @@ ov::Tensor generate(const std::shared_ptr& node, size_t port, const ov::element::Type& elemType, const ov::Shape& targetShape) { - InferenceEngine::Blob::Ptr blobPtr; switch (port) { case 0: { auto data_size = shape_size(targetShape); diff --git a/src/tests/functional/shared_test_classes/src/subgraph/scale_shift.cpp b/src/tests/functional/shared_test_classes/src/subgraph/scale_shift.cpp index 65493ad3407d67..f90231a4c0bfb7 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/scale_shift.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/scale_shift.cpp @@ -46,4 +46,3 @@ void ScaleShiftLayerTest::SetUp() { } } // namespace test } // namespace ov - diff --git a/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp b/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp index 5d55d535075e2a..35c59647712f5e 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp @@ -75,4 +75,3 @@ void SplitConvConcatBase::configure_test(const ov::test::BasicParams& param) { } // namespace test } // namespace ov - diff --git a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/precision_utils.hpp b/src/tests/test_utils/functional_test_utils/include/functional_test_utils/precision_utils.hpp new file mode 100644 index 00000000000000..38ba8b8ea515f3 --- /dev/null +++ b/src/tests/test_utils/functional_test_utils/include/functional_test_utils/precision_utils.hpp @@ -0,0 +1,62 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include + +#include "ie_precision.hpp" +#include "openvino/core/type/element_type.hpp" + +namespace FuncTestUtils { +namespace PrecisionUtils { + +// Copied from inference-engine/src/inference_engine/src/ie_ngraph_utils.hpp +inline ::ov::element::Type convertIE2nGraphPrc(const InferenceEngine::Precision& precision) { + InferenceEngine::Precision::ePrecision pType = precision; + switch (pType) { + case InferenceEngine::Precision::UNSPECIFIED: + return ::ov::element::Type(::ov::element::Type_t::undefined); + case InferenceEngine::Precision::FP64: + return ::ov::element::Type(::ov::element::Type_t::f64); + case InferenceEngine::Precision::FP32: + return ::ov::element::Type(::ov::element::Type_t::f32); + case InferenceEngine::Precision::FP16: + return ::ov::element::Type(::ov::element::Type_t::f16); + case InferenceEngine::Precision::BF16: + return ::ov::element::Type(::ov::element::Type_t::bf16); + case InferenceEngine::Precision::U4: + return ::ov::element::Type(::ov::element::Type_t::u4); + case InferenceEngine::Precision::I4: + return ::ov::element::Type(::ov::element::Type_t::i4); + case InferenceEngine::Precision::U8: + return ::ov::element::Type(::ov::element::Type_t::u8); + case InferenceEngine::Precision::I8: + return ::ov::element::Type(::ov::element::Type_t::i8); + case InferenceEngine::Precision::U16: + return ::ov::element::Type(::ov::element::Type_t::u16); + case InferenceEngine::Precision::I16: + return ::ov::element::Type(::ov::element::Type_t::i16); + case InferenceEngine::Precision::U32: + return ::ov::element::Type(::ov::element::Type_t::u32); + case InferenceEngine::Precision::I32: + return ::ov::element::Type(::ov::element::Type_t::i32); + case InferenceEngine::Precision::I64: + return ::ov::element::Type(::ov::element::Type_t::i64); + case InferenceEngine::Precision::U64: + return ::ov::element::Type(::ov::element::Type_t::u64); + case InferenceEngine::Precision::BOOL: + return ::ov::element::Type(::ov::element::Type_t::boolean); + case InferenceEngine::Precision::BIN: + return ::ov::element::Type(::ov::element::Type_t::u1); + case InferenceEngine::Precision::Q78: + case InferenceEngine::Precision::MIXED: + case InferenceEngine::Precision::CUSTOM: + default: + IE_THROW() << "Incorrect precision!"; + } +} + +} // namespace PrecisionUtils +} // namespace FuncTestUtils \ No newline at end of file