From ad1c4a24c3807d0df62aba36ce214794b6d0c6a9 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Mon, 14 Mar 2022 21:18:00 +0300 Subject: [PATCH] Deprecate version inside DiscreteTypeInfo (#10781) * Deprecate version inside DiscreteTypeInfo * Fixed code style * Fixed openvino for macOS * Fixed build for macOS * Fixed errors for Windows build --- .../include/legacy/ngraph_ops/onehot_ie.hpp | 2 + .../include/legacy/ngraph_ops/pad_ie.hpp | 2 + .../src/markup_per_tensor_quantization.cpp | 4 + .../src/markup_precisions.cpp | 4 + .../ngraph_ops/nms_static_shape_ie.hpp | 2 + src/core/include/ngraph/node.hpp | 12 +- src/core/include/openvino/core/model.hpp | 2 +- src/core/include/openvino/core/node.hpp | 3 + .../openvino/core/runtime_attribute.hpp | 2 +- src/core/include/openvino/core/type.hpp | 15 ++ src/core/src/node.cpp | 2 + src/core/src/pass/serialize.cpp | 2 + src/core/src/type.cpp | 10 ++ src/core/tests/control_dependencies.cpp | 2 +- src/core/tests/engines_util/execute_tools.hpp | 2 +- src/core/tests/opset.cpp | 2 +- src/core/tests/rtti.cpp | 1 + src/core/tests/type_info.cpp | 45 +++--- src/core/tests/util/graph_comparator.cpp | 4 + src/core/tests/visitors/user_op.cpp | 4 +- .../include/onnx_import/core/null_node.hpp | 2 +- src/inference/dev_api/exec_graph_info.hpp | 2 +- .../common/include/vpu/ngraph/utilities.hpp | 2 + .../inference_engine/ov_extension_test.cpp | 2 +- .../utils/compare_functions_test.cpp | 143 ++++++------------ .../src/matchers/single_op.cpp | 5 +- .../conversions/dynamic_shape_resolver.cpp | 4 +- .../src/utils/ngraph_helpers.cpp | 4 + 28 files changed, 150 insertions(+), 136 deletions(-) diff --git a/src/common/legacy/include/legacy/ngraph_ops/onehot_ie.hpp b/src/common/legacy/include/legacy/ngraph_ops/onehot_ie.hpp index 45496f38f90..86003814612 100644 --- a/src/common/legacy/include/legacy/ngraph_ops/onehot_ie.hpp +++ b/src/common/legacy/include/legacy/ngraph_ops/onehot_ie.hpp @@ -28,7 +28,9 @@ public: explicit OneHotIE(const Output& input, int axis, int depth, float on_value, float off_value, element::Type type); + OPENVINO_SUPPRESS_DEPRECATED_START size_t get_version() const override { return 1; } + OPENVINO_SUPPRESS_DEPRECATED_END void validate_and_infer_types() override; std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; diff --git a/src/common/legacy/include/legacy/ngraph_ops/pad_ie.hpp b/src/common/legacy/include/legacy/ngraph_ops/pad_ie.hpp index 17b89eebd42..e0e64402fc2 100644 --- a/src/common/legacy/include/legacy/ngraph_ops/pad_ie.hpp +++ b/src/common/legacy/include/legacy/ngraph_ops/pad_ie.hpp @@ -25,7 +25,9 @@ public: PadIE(const Output& input, PadMode pad_mode, CoordinateDiff pads_begin, CoordinateDiff pads_end, Shape output_shape, float pad_value); + OPENVINO_SUPPRESS_DEPRECATED_START size_t get_version() const override { return 1; } + OPENVINO_SUPPRESS_DEPRECATED_END void validate_and_infer_types() override; bool visit_attributes(AttributeVisitor& visitor) override; diff --git a/src/common/low_precision_transformations/src/markup_per_tensor_quantization.cpp b/src/common/low_precision_transformations/src/markup_per_tensor_quantization.cpp index 33f1acae181..2aca084eddf 100644 --- a/src/common/low_precision_transformations/src/markup_per_tensor_quantization.cpp +++ b/src/common/low_precision_transformations/src/markup_per_tensor_quantization.cpp @@ -16,6 +16,7 @@ ngraph::pass::low_precision::MarkupPerTensorQuantization::MarkupPerTensorQuantiz const std::vector& restrictions) { for (const OperationPerTensorQuantizationRestriction& restriction : restrictions) { const auto it = restrictionsByOperation.find(restriction.operationType.name); + OPENVINO_SUPPRESS_DEPRECATED_START if (it == restrictionsByOperation.end()) { PerTensorQuantization r(restriction.specifyVersion); r.portsByVersion.emplace(restriction.operationType.version, restriction.restrictedPorts); @@ -23,6 +24,7 @@ ngraph::pass::low_precision::MarkupPerTensorQuantization::MarkupPerTensorQuantiz } else { it->second.add(restriction.operationType.version, restriction.restrictedPorts); } + OPENVINO_SUPPRESS_DEPRECATED_END } } @@ -66,7 +68,9 @@ bool ngraph::pass::low_precision::MarkupPerTensorQuantization::run_on_model(cons } if (restriction.versionIsRequired) { + OPENVINO_SUPPRESS_DEPRECATED_START const auto it2 = restriction.portsByVersion.find(node->get_type_info().version); + OPENVINO_SUPPRESS_DEPRECATED_END if (it2 == restriction.portsByVersion.end()) { continue; } diff --git a/src/common/low_precision_transformations/src/markup_precisions.cpp b/src/common/low_precision_transformations/src/markup_precisions.cpp index d811657ecc2..9643864290f 100644 --- a/src/common/low_precision_transformations/src/markup_precisions.cpp +++ b/src/common/low_precision_transformations/src/markup_precisions.cpp @@ -23,6 +23,7 @@ ngraph::pass::low_precision::MarkupPrecisions::MarkupPrecisions(const std::vecto const std::vector& defaultPrecisions) : defaultPrecisions(defaultPrecisions) { for (const auto& restriction : restrictions) { const auto it = restrictionsByOperation.find(restriction.operationType.name); + OPENVINO_SUPPRESS_DEPRECATED_START if (it == restrictionsByOperation.end()) { Restriction r(restriction.specifyVersion); r.precisionsByVersion.emplace(restriction.operationType.version, restriction.precisionsByPort); @@ -30,6 +31,7 @@ ngraph::pass::low_precision::MarkupPrecisions::MarkupPrecisions(const std::vecto } else { it->second.add(restriction.operationType.version, restriction.precisionsByPort); } + OPENVINO_SUPPRESS_DEPRECATED_END } } @@ -92,7 +94,9 @@ bool ngraph::pass::low_precision::MarkupPrecisions::run_on_model(const std::shar if (it != restrictionsByOperation.end()) { const Restriction& r = it->second; if (r.versionIsRequired) { + OPENVINO_SUPPRESS_DEPRECATED_START const auto it2 = r.precisionsByVersion.find(typeInfo.version); + OPENVINO_SUPPRESS_DEPRECATED_END if (it2 == r.precisionsByVersion.end()) { continue; } diff --git a/src/common/transformations/include/ngraph_ops/nms_static_shape_ie.hpp b/src/common/transformations/include/ngraph_ops/nms_static_shape_ie.hpp index 573cba61849..34aaf7f0060 100644 --- a/src/common/transformations/include/ngraph_ops/nms_static_shape_ie.hpp +++ b/src/common/transformations/include/ngraph_ops/nms_static_shape_ie.hpp @@ -120,10 +120,12 @@ const ::ngraph::Node::type_info_t& NmsStaticShapeIE::get_type_info_st // but currently it will not pass conversion ot Legacy Opset correctly static const std::string name = BaseNmsOpTypeInfoPtr->name; + OPENVINO_SUPPRESS_DEPRECATED_START static const ::ngraph::Node::type_info_t type_info_static{name.c_str(), BaseNmsOpTypeInfoPtr->version, "ie_internal_opset", BaseNmsOpTypeInfoPtr}; + OPENVINO_SUPPRESS_DEPRECATED_END return type_info_static; } diff --git a/src/core/include/ngraph/node.hpp b/src/core/include/ngraph/node.hpp index a4b1108fd22..42f1c2ec63c 100644 --- a/src/core/include/ngraph/node.hpp +++ b/src/core/include/ngraph/node.hpp @@ -157,17 +157,17 @@ using ov::check_new_args_count; #define _NGRAPH_RTTI_DEFINITION_WITH_PARENT(CLASS, TYPE_NAME, _VERSION_INDEX, PARENT_CLASS) \ const ::ngraph::Node::type_info_t& CLASS::get_type_info_static() { \ static const ::ngraph::Node::type_info_t type_info_static{TYPE_NAME, \ - _VERSION_INDEX, \ + static_cast(_VERSION_INDEX), \ &PARENT_CLASS::get_type_info_static()}; \ return type_info_static; \ } \ _NGRAPH_RTTI_DEFINITION_COMMON(CLASS) -#define _NGRAPH_RTTI_DEFINITION_NO_PARENT(CLASS, TYPE_NAME, _VERSION_INDEX) \ - const ::ngraph::Node::type_info_t& CLASS::get_type_info_static() { \ - static const ::ngraph::Node::type_info_t type_info_static{TYPE_NAME, _VERSION_INDEX}; \ - return type_info_static; \ - } \ +#define _NGRAPH_RTTI_DEFINITION_NO_PARENT(CLASS, TYPE_NAME, _VERSION_INDEX) \ + const ::ngraph::Node::type_info_t& CLASS::get_type_info_static() { \ + static const ::ngraph::Node::type_info_t type_info_static{TYPE_NAME, static_cast(_VERSION_INDEX)}; \ + return type_info_static; \ + } \ _NGRAPH_RTTI_DEFINITION_COMMON(CLASS) #define NGRAPH_RTTI_DEFINITION(...) \ _OPENVINO_RTTI_EXPAND(_OPENVINO_RTTI_DEFINITION_SELECTOR(__VA_ARGS__, \ diff --git a/src/core/include/openvino/core/model.hpp b/src/core/include/openvino/core/model.hpp index a5a357ad865..0fd1d3594e7 100644 --- a/src/core/include/openvino/core/model.hpp +++ b/src/core/include/openvino/core/model.hpp @@ -43,7 +43,7 @@ class OPENVINO_API Model : public std::enable_shared_from_this { public: static const ::ov::DiscreteTypeInfo& get_type_info_static() { - static const ::ov::DiscreteTypeInfo type_info_static{"Model", 0}; + static const ::ov::DiscreteTypeInfo type_info_static{"Model", static_cast(0)}; return type_info_static; } const ::ov::DiscreteTypeInfo& get_type_info() const { diff --git a/src/core/include/openvino/core/node.hpp b/src/core/include/openvino/core/node.hpp index 9472b9d718a..5affb41d5b6 100644 --- a/src/core/include/openvino/core/node.hpp +++ b/src/core/include/openvino/core/node.hpp @@ -424,8 +424,11 @@ public: NodeVector get_users(bool check_is_used = false) const; /// \return Version of this node + OPENVINO_DEPRECATED("This method is deprecated and will be removed soon.") virtual size_t get_version() const { + OPENVINO_SUPPRESS_DEPRECATED_START return get_type_info().version; + OPENVINO_SUPPRESS_DEPRECATED_END } OPENVINO_DEPRECATED("This method is deprecated and will be removed soon.") diff --git a/src/core/include/openvino/core/runtime_attribute.hpp b/src/core/include/openvino/core/runtime_attribute.hpp index f799a2316e1..9fde1106ffc 100644 --- a/src/core/include/openvino/core/runtime_attribute.hpp +++ b/src/core/include/openvino/core/runtime_attribute.hpp @@ -20,7 +20,7 @@ class Any; class OPENVINO_API RuntimeAttribute { public: static const DiscreteTypeInfo& get_type_info_static() { - static const ::ov::DiscreteTypeInfo type_info_static{"RuntimeAttribute", 0}; + static const ::ov::DiscreteTypeInfo type_info_static{"RuntimeAttribute", static_cast(0)}; return type_info_static; } virtual const DiscreteTypeInfo& get_type_info() const { diff --git a/src/core/include/openvino/core/type.hpp b/src/core/include/openvino/core/type.hpp index 6c6f2119d98..c2ef27b45ef 100644 --- a/src/core/include/openvino/core/type.hpp +++ b/src/core/include/openvino/core/type.hpp @@ -27,6 +27,7 @@ namespace ov { /// related to any other type. struct OPENVINO_API DiscreteTypeInfo { const char* name; + OPENVINO_DEPRECATED("This member was deprecated. Please use version_id instead.") uint64_t version; const char* version_id; // A pointer to a parent type info; used for casting and inheritance traversal, not for @@ -34,6 +35,19 @@ struct OPENVINO_API DiscreteTypeInfo { const DiscreteTypeInfo* parent; DiscreteTypeInfo() = default; + OPENVINO_SUPPRESS_DEPRECATED_START + DiscreteTypeInfo(const DiscreteTypeInfo&) = default; + DiscreteTypeInfo(DiscreteTypeInfo&&) = default; + DiscreteTypeInfo& operator=(const DiscreteTypeInfo&) = default; + + explicit constexpr DiscreteTypeInfo(const char* _name, + const char* _version_id, + const DiscreteTypeInfo* _parent = nullptr) + : name(_name), + version(0), + version_id(_version_id), + parent(_parent), + hash_value(0) {} constexpr DiscreteTypeInfo(const char* _name, uint64_t _version, const DiscreteTypeInfo* _parent = nullptr) : name(_name), @@ -51,6 +65,7 @@ struct OPENVINO_API DiscreteTypeInfo { version_id(_version_id), parent(_parent), hash_value(0) {} + OPENVINO_SUPPRESS_DEPRECATED_END bool is_castable(const DiscreteTypeInfo& target_type) const; diff --git a/src/core/src/node.cpp b/src/core/src/node.cpp index 5c856729dfb..d8164ba336e 100644 --- a/src/core/src/node.cpp +++ b/src/core/src/node.cpp @@ -381,7 +381,9 @@ std::ostream& ov::Node::write_description(std::ostream& out, uint32_t depth) con if (depth == 0) { out << get_friendly_name(); } else { + OPENVINO_SUPPRESS_DEPRECATED_START out << "v" << get_type_info().version << "::" << get_type_info().name << " " << get_friendly_name() << " ("; + OPENVINO_SUPPRESS_DEPRECATED_END string sep = ""; for (const auto& arg : input_values()) { out << sep << arg; diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp index 2c86d37d2f9..e4ee0ba61f3 100644 --- a/src/core/src/pass/serialize.cpp +++ b/src/core/src/pass/serialize.cpp @@ -942,9 +942,11 @@ void ngfunction_2_ir(pugi::xml_node& netXml, // WA for LSTMCellv0, peephole input shall not be serialized if (e.to_port == 6) { auto type_info = f.get_ordered_ops()[e.to_layer]->get_type_info(); + OPENVINO_SUPPRESS_DEPRECATED_START if (!strcmp(type_info.name, "LSTMCell") && type_info.version == 0) { continue; } + OPENVINO_SUPPRESS_DEPRECATED_END } pugi::xml_node edge = edges.append_child("edge"); edge.append_attribute("from-layer").set_value(e.from_layer); diff --git a/src/core/src/type.cpp b/src/core/src/type.cpp index 67293197971..7894deb579c 100644 --- a/src/core/src/type.cpp +++ b/src/core/src/type.cpp @@ -18,7 +18,9 @@ size_t DiscreteTypeInfo::hash() const { if (hash_value != 0) return hash_value; size_t name_hash = name ? std::hash()(std::string(name)) : 0; + OPENVINO_SUPPRESS_DEPRECATED_START size_t version_hash = std::hash()(version); + OPENVINO_SUPPRESS_DEPRECATED_END size_t version_id_hash = version_id ? std::hash()(std::string(version_id)) : 0; return ov::util::hash_combine(std::vector{name_hash, version_hash, version_id_hash}); @@ -38,7 +40,9 @@ std::string DiscreteTypeInfo::get_version() const { if (version_id) { return std::string(version_id); } + OPENVINO_SUPPRESS_DEPRECATED_START return std::to_string(version); + OPENVINO_SUPPRESS_DEPRECATED_END } DiscreteTypeInfo::operator std::string() const { @@ -47,8 +51,10 @@ DiscreteTypeInfo::operator std::string() const { std::ostream& operator<<(std::ostream& s, const DiscreteTypeInfo& info) { std::string version_id = info.version_id ? info.version_id : "(empty)"; + OPENVINO_SUPPRESS_DEPRECATED_START s << "DiscreteTypeInfo{name: " << info.name << ", version_id: " << version_id << ", old_version: " << info.version << ", parent: "; + OPENVINO_SUPPRESS_DEPRECATED_END if (!info.parent) s << info.parent; else @@ -60,6 +66,7 @@ std::ostream& operator<<(std::ostream& s, const DiscreteTypeInfo& info) { // parent is commented to fix type relaxed operations bool DiscreteTypeInfo::operator<(const DiscreteTypeInfo& b) const { + OPENVINO_SUPPRESS_DEPRECATED_START if (version < b.version) return true; if (version == b.version && name != nullptr && b.name != nullptr) { @@ -74,12 +81,15 @@ bool DiscreteTypeInfo::operator<(const DiscreteTypeInfo& b) const { } } + OPENVINO_SUPPRESS_DEPRECATED_END return false; } bool DiscreteTypeInfo::operator==(const DiscreteTypeInfo& b) const { if (hash_value != 0 && b.hash_value != 0) return hash() == b.hash(); + OPENVINO_SUPPRESS_DEPRECATED_START return version == b.version && strcmp(name, b.name) == 0; + OPENVINO_SUPPRESS_DEPRECATED_END } bool DiscreteTypeInfo::operator<=(const DiscreteTypeInfo& b) const { return *this == b || *this < b; diff --git a/src/core/tests/control_dependencies.cpp b/src/core/tests/control_dependencies.cpp index a9bcc461142..078af0447f2 100644 --- a/src/core/tests/control_dependencies.cpp +++ b/src/core/tests/control_dependencies.cpp @@ -29,7 +29,7 @@ using namespace std; class ControlDependencyOp : public ngraph::op::Op { public: - static constexpr NodeTypeInfo type_info{"ControlDependencyOp", 0}; + static constexpr NodeTypeInfo type_info{"ControlDependencyOp", static_cast(0)}; const NodeTypeInfo& get_type_info() const override { return type_info; } diff --git a/src/core/tests/engines_util/execute_tools.hpp b/src/core/tests/engines_util/execute_tools.hpp index c5091666a01..901a547c855 100644 --- a/src/core/tests/engines_util/execute_tools.hpp +++ b/src/core/tests/engines_util/execute_tools.hpp @@ -27,7 +27,7 @@ namespace ngraph { class TestOpMultiOut : public op::Op { public: - static constexpr NodeTypeInfo type_info{"TestOpMultiOut", 0}; + static constexpr NodeTypeInfo type_info{"TestOpMultiOut", static_cast(0)}; const NodeTypeInfo& get_type_info() const override { return type_info; } diff --git a/src/core/tests/opset.cpp b/src/core/tests/opset.cpp index 99b29f1104d..1a5b9d093d0 100644 --- a/src/core/tests/opset.cpp +++ b/src/core/tests/opset.cpp @@ -146,7 +146,7 @@ TEST(opset, opset8_dump) { class MyOpOld : public ov::op::Op { public: - static constexpr ov::DiscreteTypeInfo type_info{"MyOpOld", 0}; + static constexpr ov::DiscreteTypeInfo type_info{"MyOpOld", static_cast(0)}; const ov::DiscreteTypeInfo& get_type_info() const override { return type_info; } diff --git a/src/core/tests/rtti.cpp b/src/core/tests/rtti.cpp index be755144410..a77d569d141 100644 --- a/src/core/tests/rtti.cpp +++ b/src/core/tests/rtti.cpp @@ -50,6 +50,7 @@ public: } }; +OPENVINO_SUPPRESS_DEPRECATED_START TEST(rtti, op_with_type) { auto op = OpType(); auto type_info = op.get_type_info(); diff --git a/src/core/tests/type_info.cpp b/src/core/tests/type_info.cpp index 448d76c8483..56adbf912b1 100644 --- a/src/core/tests/type_info.cpp +++ b/src/core/tests/type_info.cpp @@ -8,12 +8,13 @@ #include "openvino/opsets/opset.hpp" #include "openvino/util/common_util.hpp" +OPENVINO_SUPPRESS_DEPRECATED_START TEST(type_info, compare_old_type) { - ov::DiscreteTypeInfo type1("type1", 0); - ov::DiscreteTypeInfo type2("type2", 0); - ov::DiscreteTypeInfo type3("type1", 1); - ov::DiscreteTypeInfo type4("type3", 0, &type1); - ov::DiscreteTypeInfo type5("type3", 0, &type2); + ov::DiscreteTypeInfo type1("type1", static_cast(0)); + ov::DiscreteTypeInfo type2("type2", static_cast(0)); + ov::DiscreteTypeInfo type3("type1", 1ul); + ov::DiscreteTypeInfo type4("type3", static_cast(0), &type1); + ov::DiscreteTypeInfo type5("type3", static_cast(0), &type2); ASSERT_TRUE(type1 != type2); ASSERT_TRUE(type1 == type1); ASSERT_TRUE(type1 < type2); @@ -27,11 +28,11 @@ TEST(type_info, compare_old_type) { } TEST(type_info, compare_new_type) { - ov::DiscreteTypeInfo type1("type1", 0, "version1"); - ov::DiscreteTypeInfo type2("type2", 0, "version1"); - ov::DiscreteTypeInfo type3("type1", 1, "version2"); - ov::DiscreteTypeInfo type4("type3", 0, "version3", &type1); - ov::DiscreteTypeInfo type5("type3", 0, "version3", &type2); + ov::DiscreteTypeInfo type1("type1", "version1"); + ov::DiscreteTypeInfo type2("type2", "version1"); + ov::DiscreteTypeInfo type3("type1", "version2"); + ov::DiscreteTypeInfo type4("type3", "version3", &type1); + ov::DiscreteTypeInfo type5("type3", "version3", &type2); ASSERT_TRUE(type1 != type2); ASSERT_TRUE(type1 == type1); ASSERT_TRUE(type1 < type2); @@ -45,8 +46,8 @@ TEST(type_info, compare_new_type) { } TEST(type_info, compare_new_with_old_type) { - ov::DiscreteTypeInfo type1("type1", 0, "version1"); - ov::DiscreteTypeInfo type1_o("type1", 0); + ov::DiscreteTypeInfo type1("type1", static_cast(0), "version1"); + ov::DiscreteTypeInfo type1_o("type1", static_cast(0)); ASSERT_TRUE(type1 == type1_o); } @@ -61,8 +62,8 @@ TEST(type_info, check_hash_value) { ov::DiscreteTypeInfo type("type1", 0, "version1"); ov::DiscreteTypeInfo type_old("type1", 1); ov::DiscreteTypeInfo type_with_version("type1", 1, "version1"); - ov::DiscreteTypeInfo type_empty_name("", 0); - ov::DiscreteTypeInfo type_empty_ver("type", 0, ""); + ov::DiscreteTypeInfo type_empty_name("", static_cast(0)); + ov::DiscreteTypeInfo type_empty_ver("type", static_cast(0), ""); EXPECT_EQ(hash_val(type.name, type.version_id, type.version), type.hash()); EXPECT_EQ(hash_val(type_old.name, type_old.version_id, type_old.version), type_old.hash()); EXPECT_EQ(hash_val(type_with_version.name, type_with_version.version_id, type_with_version.version), @@ -74,11 +75,11 @@ TEST(type_info, check_hash_value) { TEST(type_info, find_in_map) { std::vector vector_names; - ov::DiscreteTypeInfo a("Mod", 1, "opset1"); - ov::DiscreteTypeInfo b("Prelu", 0, "opset1"); - ov::DiscreteTypeInfo c("Vector", 0); - ov::DiscreteTypeInfo d("Mod", 1, "opset3"); - ov::DiscreteTypeInfo f("Mod", 2); + ov::DiscreteTypeInfo a("Mod", 1ul, "opset1"); + ov::DiscreteTypeInfo b("Prelu", static_cast(0), "opset1"); + ov::DiscreteTypeInfo c("Vector", static_cast(0)); + ov::DiscreteTypeInfo d("Mod", 1ul, "opset3"); + ov::DiscreteTypeInfo f("Mod", 2ul); std::map test_map; test_map[a] = 1; @@ -94,19 +95,19 @@ TEST(type_info, find_in_map) { std::string name = type.name; vector_names.emplace_back(name); ov::DiscreteTypeInfo t(vector_names.rbegin()->c_str(), 1000); - ov::DiscreteTypeInfo t2(vector_names.rbegin()->c_str(), 0); + ov::DiscreteTypeInfo t2(vector_names.rbegin()->c_str(), static_cast(0)); test_map[t] = 3; test_map[t2] = 4; std::string name1 = "a" + name; vector_names.emplace_back(name1); ov::DiscreteTypeInfo t3(vector_names.rbegin()->c_str(), 1000); - ov::DiscreteTypeInfo t4(vector_names.rbegin()->c_str(), 0); + ov::DiscreteTypeInfo t4(vector_names.rbegin()->c_str(), static_cast(0)); test_map[t3] = 5; test_map[t4] = 6; std::string name2 = name + "z"; vector_names.emplace_back(name2); ov::DiscreteTypeInfo t5(vector_names.rbegin()->c_str(), 1000); - ov::DiscreteTypeInfo t6(vector_names.rbegin()->c_str(), 0); + ov::DiscreteTypeInfo t6(vector_names.rbegin()->c_str(), static_cast(0)); test_map[t5] = 7; test_map[t6] = 8; } diff --git a/src/core/tests/util/graph_comparator.cpp b/src/core/tests/util/graph_comparator.cpp index 435e8ccc436..76a72195110 100644 --- a/src/core/tests/util/graph_comparator.cpp +++ b/src/core/tests/util/graph_comparator.cpp @@ -27,9 +27,11 @@ bool is_type_relaxed(const std::string& type) { } bool compare_type_info(const ngraph::DiscreteTypeInfo& info1, const ngraph::DiscreteTypeInfo& info2) { + OPENVINO_SUPPRESS_DEPRECATED_START if (!is_type_relaxed(info1.name) && !is_type_relaxed(info2.name) && (info1.version != info2.version)) { return false; } + OPENVINO_SUPPRESS_DEPRECATED_END const std::string info1Name = is_type_relaxed(info1.name) && (info1.parent != nullptr) ? info1.parent->name : info1.name; @@ -76,7 +78,9 @@ bool less_by_parent_name(const std::shared_ptr& l, } std::string typeInfoToStr(const ngraph::Node::type_info_t& typeInfo) { + OPENVINO_SUPPRESS_DEPRECATED_START return std::string(typeInfo.name) + "/" + to_str(typeInfo.version); + OPENVINO_SUPPRESS_DEPRECATED_END } std::string tensor_names(const ngraph::descriptor::Tensor& t) { diff --git a/src/core/tests/visitors/user_op.cpp b/src/core/tests/visitors/user_op.cpp index eae6a95c33c..3253c3bbd5f 100644 --- a/src/core/tests/visitors/user_op.cpp +++ b/src/core/tests/visitors/user_op.cpp @@ -31,7 +31,7 @@ class AttributeAdapter : public EnumAttributeAdapterBase(value) {} - static constexpr DiscreteTypeInfo type_info{"AttributeAdapter", 0}; + static constexpr DiscreteTypeInfo type_info{"AttributeAdapter", static_cast(0)}; const DiscreteTypeInfo& get_type_info() const override { return type_info; } @@ -64,7 +64,7 @@ public: visitor.on_attribute("z", m_ref.z); return true; } - static constexpr DiscreteTypeInfo type_info{"AttributeAdapter", 0}; + static constexpr DiscreteTypeInfo type_info{"AttributeAdapter", static_cast(0)}; const DiscreteTypeInfo& get_type_info() const override { return type_info; } diff --git a/src/frontends/onnx/frontend/include/onnx_import/core/null_node.hpp b/src/frontends/onnx/frontend/include/onnx_import/core/null_node.hpp index 9cbcae4dfda..53be30c1b56 100644 --- a/src/frontends/onnx/frontend/include/onnx_import/core/null_node.hpp +++ b/src/frontends/onnx/frontend/include/onnx_import/core/null_node.hpp @@ -30,7 +30,7 @@ namespace onnx_import { /// https://github.com/onnx/onnx/blob/master/docs/IR.md#optional-inputs-and-outputs class ONNX_IMPORTER_API NullNode : public ngraph::Node { public: - static constexpr NodeTypeInfo type_info{"NullNode", 0}; + static constexpr NodeTypeInfo type_info{"NullNode", static_cast(0)}; const NodeTypeInfo& get_type_info() const override { return type_info; } diff --git a/src/inference/dev_api/exec_graph_info.hpp b/src/inference/dev_api/exec_graph_info.hpp index 9bde910b4bd..7e34ae0c7ab 100644 --- a/src/inference/dev_api/exec_graph_info.hpp +++ b/src/inference/dev_api/exec_graph_info.hpp @@ -91,7 +91,7 @@ static const char RUNTIME_PRECISION[] = "runtimePrecision"; */ class INFERENCE_ENGINE_API_CLASS(ExecutionNode) : public ngraph::Node { public: - static constexpr ngraph::NodeTypeInfo type_info{"ExecutionNode", 0}; + static constexpr ngraph::NodeTypeInfo type_info{"ExecutionNode", static_cast(0)}; const ngraph::NodeTypeInfo& get_type_info() const override; /** diff --git a/src/plugins/intel_myriad/common/include/vpu/ngraph/utilities.hpp b/src/plugins/intel_myriad/common/include/vpu/ngraph/utilities.hpp index 5c4372df72f..d6b514936f5 100644 --- a/src/plugins/intel_myriad/common/include/vpu/ngraph/utilities.hpp +++ b/src/plugins/intel_myriad/common/include/vpu/ngraph/utilities.hpp @@ -41,7 +41,9 @@ std::shared_ptr gatherShapeElements(const ngraph::Output inline void printTo(std::ostream& stream, const ngraph::NodeTypeInfo& object) { + OPENVINO_SUPPRESS_DEPRECATED_START stream << object.name << " ver. " << object.version; + OPENVINO_SUPPRESS_DEPRECATED_END } using Nodes = std::unordered_set; diff --git a/src/tests/functional/inference_engine/ov_extension_test.cpp b/src/tests/functional/inference_engine/ov_extension_test.cpp index 21aa4cf4983..cecb1d9f30b 100644 --- a/src/tests/functional/inference_engine/ov_extension_test.cpp +++ b/src/tests/functional/inference_engine/ov_extension_test.cpp @@ -181,7 +181,7 @@ std::string getOVExtensionPath() { class CustomOldIdentity : public ngraph::op::Op { public: - static constexpr ngraph::NodeTypeInfo type_info{"Identity", 0}; + static constexpr ngraph::NodeTypeInfo type_info{"Identity", static_cast(0)}; const ngraph::NodeTypeInfo& get_type_info() const override { return type_info; } diff --git a/src/tests/functional/inference_engine/transformations/utils/compare_functions_test.cpp b/src/tests/functional/inference_engine/transformations/utils/compare_functions_test.cpp index 84f634c790b..e380f5045ac 100644 --- a/src/tests/functional/inference_engine/transformations/utils/compare_functions_test.cpp +++ b/src/tests/functional/inference_engine/transformations/utils/compare_functions_test.cpp @@ -2,23 +2,21 @@ // SPDX-License-Identifier: Apache-2.0 // +#include #include -#include - #include -#include -#include -#include "common_test_utils/test_common.hpp" - #include #include #include #include +#include +#include #include #include #include "common_test_utils/ngraph_test_utils.hpp" +#include "common_test_utils/test_common.hpp" using namespace testing; using namespace ngraph; @@ -50,8 +48,7 @@ TEST(TransformationTests, CompareFunctoinsTIPositive) { auto reshape_pattern_2 = ngraph::opset5::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {1, 1, 128}); auto unsqueeze = std::make_shared(lstm_cell, reshape_pattern_2, false); auto res_2 = std::make_shared(unsqueeze); - auto body = std::make_shared(OutputVector{res_1, res_2}, - ParameterVector{Xi, Yi, Zi}); + auto body = std::make_shared(OutputVector{res_1, res_2}, ParameterVector{Xi, Yi, Zi}); auto tensor_iterator = std::make_shared(); tensor_iterator->set_body(body); @@ -64,8 +61,7 @@ TEST(TransformationTests, CompareFunctoinsTIPositive) { auto out1 = tensor_iterator->get_concatenated_slices(res_2, 0, 1, 1, -1, 1); auto res_ti_1 = std::make_shared(tensor_iterator->output(1)); - f = std::make_shared(ngraph::NodeVector{res_ti_1}, - ngraph::ParameterVector{X, Y, Z}); + f = std::make_shared(ngraph::NodeVector{res_ti_1}, ngraph::ParameterVector{X, Y, Z}); } { @@ -95,8 +91,7 @@ TEST(TransformationTests, CompareFunctoinsTIPositive) { auto unsqueeze = std::make_shared(lstm_cell, reshape_pattern_2, false); auto res_2 = std::make_shared(unsqueeze); res_2->set_friendly_name("res_2"); - auto body = std::make_shared(OutputVector{res_1, res_2}, - ParameterVector{Xi, Yi, Zi}); + auto body = std::make_shared(OutputVector{res_1, res_2}, ParameterVector{Xi, Yi, Zi}); auto tensor_iterator = std::make_shared(); tensor_iterator->set_body(body); @@ -109,8 +104,7 @@ TEST(TransformationTests, CompareFunctoinsTIPositive) { auto out1 = tensor_iterator->get_concatenated_slices(res_2, 0, 1, 1, -1, 1); auto res_ti_1 = std::make_shared(tensor_iterator->output(1)); - f_ref = std::make_shared(ngraph::NodeVector{res_ti_1}, - ngraph::ParameterVector{X, Y, Z}); + f_ref = std::make_shared(ngraph::NodeVector{res_ti_1}, ngraph::ParameterVector{X, Y, Z}); } auto res = compare_functions(f, f_ref); @@ -144,8 +138,7 @@ TEST(TransformationTests, CompareFunctoinsTINegative) { auto reshape_pattern_2 = ngraph::opset5::Constant::create(ngraph::element::i64, ngraph::Shape{3}, {1, 1, 128}); auto unsqueeze = std::make_shared(lstm_cell, reshape_pattern_2, false); auto res_2 = std::make_shared(unsqueeze); - auto body = std::make_shared(OutputVector{res_1, res_2}, - ParameterVector{Xi, Yi, Zi}); + auto body = std::make_shared(OutputVector{res_1, res_2}, ParameterVector{Xi, Yi, Zi}); auto tensor_iterator = std::make_shared(); tensor_iterator->set_body(body); @@ -158,8 +151,7 @@ TEST(TransformationTests, CompareFunctoinsTINegative) { auto out1 = tensor_iterator->get_concatenated_slices(res_2, 0, 1, 1, -1, 1); auto res_ti_1 = std::make_shared(tensor_iterator->output(1)); - f = std::make_shared(ngraph::NodeVector{res_ti_1}, - ngraph::ParameterVector{X, Y, Z}); + f = std::make_shared(ngraph::NodeVector{res_ti_1}, ngraph::ParameterVector{X, Y, Z}); } { @@ -190,8 +182,7 @@ TEST(TransformationTests, CompareFunctoinsTINegative) { auto unsqueeze = std::make_shared(lstm_cell, reshape_pattern_2, false); auto res_2 = std::make_shared(unsqueeze); res_2->set_friendly_name("res_2"); - auto body = std::make_shared(OutputVector{res_1, res_2}, - ParameterVector{Xi, Yi, Zi}); + auto body = std::make_shared(OutputVector{res_1, res_2}, ParameterVector{Xi, Yi, Zi}); auto tensor_iterator = std::make_shared(); tensor_iterator->set_body(body); @@ -204,8 +195,7 @@ TEST(TransformationTests, CompareFunctoinsTINegative) { auto out1 = tensor_iterator->get_concatenated_slices(res_2, 0, 1, 1, -1, 1); auto res_ti_1 = std::make_shared(tensor_iterator->output(1)); - f_ref = std::make_shared(ngraph::NodeVector{res_ti_1}, - ngraph::ParameterVector{X, Y, Z}); + f_ref = std::make_shared(ngraph::NodeVector{res_ti_1}, ngraph::ParameterVector{X, Y, Z}); } const auto fc = FunctionsComparator::with_default().enable(FunctionsComparator::ATTRIBUTES); @@ -237,8 +227,7 @@ TEST(TransformationTests, CompareFunctoinsTINegativeDifferentElementTypeBetweenS auto out = ti->get_concatenated_slices(result, 0, 1, 1, -1, 1); - return std::make_shared( - NodeVector{out.get_node_shared_ptr()}, ParameterVector{X, Y}); + return std::make_shared(NodeVector{out.get_node_shared_ptr()}, ParameterVector{X, Y}); }; const auto f1 = createFunc(element::f32); const auto f2 = createFunc(element::f16); @@ -274,8 +263,7 @@ TEST(TransformationTests, CompareFunctoinsTINegativeDifferentElementTypeBetweenI auto out = ti->get_concatenated_slices(result, 0, 1, 1, -1, 1); - return std::make_shared( - NodeVector{out.get_node_shared_ptr()}, ParameterVector{X, Y}); + return std::make_shared(NodeVector{out.get_node_shared_ptr()}, ParameterVector{X, Y}); }; const auto f1 = createFunc(element::f32); @@ -310,8 +298,7 @@ TEST(TransformationTests, CompareFunctoinsTINegativeDifferentElementTypeBetweent auto out = ti->get_concatenated_slices(result, 0, 1, 1, -1, 1); - auto fn = std::make_shared( - NodeVector{out.get_node_shared_ptr()}, ParameterVector{X, Y}); + auto fn = std::make_shared(NodeVector{out.get_node_shared_ptr()}, ParameterVector{X, Y}); /// << auto&& result_out = result->output(0); @@ -321,7 +308,7 @@ TEST(TransformationTests, CompareFunctoinsTINegativeDifferentElementTypeBetweent return fn; }; - { // check element type difference + { // check element type difference const auto f1 = createFunc(element::u16, Shape{10, 20}); const auto f2 = createFunc(element::u64, Shape{10, 20}); @@ -332,7 +319,7 @@ TEST(TransformationTests, CompareFunctoinsTINegativeDifferentElementTypeBetweent EXPECT_FALSE(result.valid); EXPECT_THAT(result.message, HasSubstr("outputs and results mismatch")); } - { // check Shape difference + { // check Shape difference const auto f1 = createFunc(element::u16, Shape{11, 20}); const auto f2 = createFunc(element::u16, Shape{12, 20}); @@ -350,8 +337,7 @@ TEST(TransformationTests, ConstantNegativeDifferentElementType) { using namespace ngraph::opset5; auto constant = Constant::create(t, ngraph::Shape{1}, {1.1}); - return std::make_shared( - ngraph::NodeVector{constant}, ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{constant}, ngraph::ParameterVector{}); }; const auto& f1 = createConstantFunc(ngraph::element::f64); @@ -368,8 +354,7 @@ TEST(TransformationTests, ConstantNegativeDifferentValues) { using namespace ngraph::opset5; auto constant = Constant::create(ngraph::element::f32, ngraph::Shape{1}, {value}); - return std::make_shared( - ngraph::NodeVector{constant}, ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{constant}, ngraph::ParameterVector{}); }; const auto& f1 = createConstantFunc(1.0); @@ -386,8 +371,7 @@ TEST(TransformationTests, ConstantNegativeDifferentShapes) { using namespace ngraph::opset5; auto constant = Constant::create(ngraph::element::f32, s, {1.1}); - return std::make_shared( - ngraph::NodeVector{constant}, ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{constant}, ngraph::ParameterVector{}); }; const auto& f1 = createConstantFunc(ngraph::Shape{2}); @@ -405,8 +389,7 @@ TEST(TransformationTests, ClampNegativeDifferentMin) { auto constant = Constant::create(ngraph::element::f32, ngraph::Shape{1}, {1.0}); auto clamp = std::make_shared(constant, min, 20.); - return std::make_shared( - ngraph::NodeVector{clamp}, ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{clamp}, ngraph::ParameterVector{}); }; const auto& f1 = createClampFunc(1.0); @@ -424,8 +407,7 @@ TEST(TransformationTests, ClampNegativeDifferentMax) { auto constant = Constant::create(ngraph::element::f32, ngraph::Shape{1}, {1.0}); auto clamp = std::make_shared(constant, 1., max); - return std::make_shared( - ngraph::NodeVector{clamp}, ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{clamp}, ngraph::ParameterVector{}); }; const auto& f1 = createClampFunc(10.1); @@ -440,12 +422,10 @@ TEST(TransformationTests, ClampNegativeDifferentMax) { TEST(TransformationTests, ConcatNegativeDifferentMax) { const auto createConcatFunc = [](int64_t axis) { using namespace ngraph::opset5; - auto constant = - Constant::create(ngraph::element::f32, ngraph::Shape{10, 10, 2, 2, 3}, {1.0}); + auto constant = Constant::create(ngraph::element::f32, ngraph::Shape{10, 10, 2, 2, 3}, {1.0}); auto clamp = std::make_shared(ngraph::OutputVector{constant}, axis); - return std::make_shared( - ngraph::NodeVector{clamp}, ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{clamp}, ngraph::ParameterVector{}); }; const auto& f1 = createConcatFunc(1); @@ -500,12 +480,11 @@ TEST(TransformationTests, ReorgYoloNegativeDifferentMax) { const auto createReorgYoloFunc = [](const Strides& stride) { using namespace ngraph::opset5; - auto param = - std::make_shared(ngraph::element::f32, ngraph::Shape{10, 10, 10, 10}); + auto param = std::make_shared(ngraph::element::f32, ngraph::Shape{10, 10, 10, 10}); auto reorg_yolo = std::make_shared(param, stride); - return std::make_shared( - std::make_shared(reorg_yolo), ngraph::ParameterVector{param}); + return std::make_shared(std::make_shared(reorg_yolo), + ngraph::ParameterVector{param}); }; const auto& f1 = createReorgYoloFunc({1, 2}); @@ -524,20 +503,18 @@ class DummyConstant : public ngraph::op::Op { public: DummyConstant() = default; - DummyConstant(const Member& member) - : m_element_type(element::Type_t::u8), m_shape({1, 1}), m_member(member) { + DummyConstant(const Member& member) : m_element_type(element::Type_t::u8), m_shape({1, 1}), m_member(member) { constructor_validate_and_infer_types(); } - DummyConstant(const DummyConstant& o) - : m_element_type(o.m_element_type), m_shape(o.m_shape), m_member(o.m_member) { + DummyConstant(const DummyConstant& o) : m_element_type(o.m_element_type), m_shape(o.m_shape), m_member(o.m_member) { constructor_validate_and_infer_types(); } DummyConstant& operator=(const DummyConstant&) = delete; const NodeTypeInfo& get_type_info() const override { - static const NodeTypeInfo type_info{typeid(this).name(), 0}; + static const NodeTypeInfo type_info{typeid(this).name(), static_cast(0)}; return type_info; } @@ -576,8 +553,7 @@ template std::shared_ptr createDummyFunc(const Member& m) { auto constant = std::make_shared>(m); - return std::make_shared( - ngraph::NodeVector{constant}, ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{constant}, ngraph::ParameterVector{}); } } // namespace @@ -631,19 +607,16 @@ class AttributeAdapter { public: AttributeAdapter(TestDummyDataTypeTransformationTests_NO_NGRAPH_NAME_COLISION& value) - : DirectValueAccessor(value) { - } + : DirectValueAccessor(value) {} - static constexpr DiscreteTypeInfo type_info{ - "TestDummyDataTypeTransformationTests_NO_NGRAPH_NAME_COLISION", 0}; + static constexpr DiscreteTypeInfo type_info{"TestDummyDataTypeTransformationTests_NO_NGRAPH_NAME_COLISION", static_cast(0)}; const DiscreteTypeInfo& get_type_info() const override { return type_info; } }; -constexpr DiscreteTypeInfo - AttributeAdapter::type_info; +constexpr DiscreteTypeInfo AttributeAdapter::type_info; } // namespace ov @@ -702,8 +675,7 @@ const auto createU1ConstantFunc = [](const Shape& s, const uint8_t* data) { using namespace ngraph::opset5; auto c = std::make_shared(element::u1, s, data); - return std::make_shared(ngraph::NodeVector{c}, - ngraph::ParameterVector{}); + return std::make_shared(ngraph::NodeVector{c}, ngraph::ParameterVector{}); }; } @@ -711,13 +683,10 @@ TEST(TransformationTests, ConstantComparison_ElementTypeU1_Positive_1stbit) { const Shape shape{1}; const uint8_t data[1] = {0x80}; // 1000'0000 - const auto& f1 = - createU1ConstantFunc(shape, static_cast(data)); - const auto& f2 = - createU1ConstantFunc(shape, static_cast(data)); + const auto& f1 = createU1ConstantFunc(shape, static_cast(data)); + const auto& f2 = createU1ConstantFunc(shape, static_cast(data)); - const auto fc = FunctionsComparator::with_default().enable( - FunctionsComparator::CONST_VALUES); + const auto fc = FunctionsComparator::with_default().enable(FunctionsComparator::CONST_VALUES); const auto res = fc.compare(f1, f2); EXPECT_TRUE(res.valid) << res.message; } @@ -726,13 +695,10 @@ TEST(TransformationTests, ConstantComparison_ElementTypeU1_Positive_9thbit) { const Shape shape{9}; const uint8_t data[2] = {0x00, 0x80}; // 0000'0000 1000'0000 - const auto& f1 = - createU1ConstantFunc(shape, static_cast(data)); - const auto& f2 = - createU1ConstantFunc(shape, static_cast(data)); + const auto& f1 = createU1ConstantFunc(shape, static_cast(data)); + const auto& f2 = createU1ConstantFunc(shape, static_cast(data)); - const auto fc = FunctionsComparator::with_default().enable( - FunctionsComparator::CONST_VALUES); + const auto fc = FunctionsComparator::with_default().enable(FunctionsComparator::CONST_VALUES); const auto res = fc.compare(f1, f2); EXPECT_TRUE(res.valid) << res.message; } @@ -743,13 +709,10 @@ TEST(TransformationTests, ConstantComparison_ElementTypeU1_Positive_garbage) { const uint8_t data1[2] = {0xAA, 0x8F}; // 1010'1010 1000'1111 const uint8_t data2[2] = {0xAA, 0xF0}; // 1010'1010 1111'0000 - const auto& f1 = - createU1ConstantFunc(shape, static_cast(data1)); - const auto& f2 = - createU1ConstantFunc(shape, static_cast(data2)); + const auto& f1 = createU1ConstantFunc(shape, static_cast(data1)); + const auto& f2 = createU1ConstantFunc(shape, static_cast(data2)); - const auto fc = FunctionsComparator::with_default().enable( - FunctionsComparator::CONST_VALUES); + const auto fc = FunctionsComparator::with_default().enable(FunctionsComparator::CONST_VALUES); const auto res = fc.compare(f1, f2); EXPECT_TRUE(res.valid) << res.message; } @@ -759,13 +722,10 @@ TEST(TransformationTests, ConstantComparison_ElementTypeU1_Negative) { const uint8_t data1[1] = {0x80}; // 1000 0000 const uint8_t data2[1] = {0x01}; // 0000 0001 - const auto& f1 = - createU1ConstantFunc(shape, static_cast(data1)); - const auto& f2 = - createU1ConstantFunc(shape, static_cast(data2)); + const auto& f1 = createU1ConstantFunc(shape, static_cast(data1)); + const auto& f2 = createU1ConstantFunc(shape, static_cast(data2)); - const auto fc = FunctionsComparator::with_default().enable( - FunctionsComparator::CONST_VALUES); + const auto fc = FunctionsComparator::with_default().enable(FunctionsComparator::CONST_VALUES); const auto res = fc.compare(f1, f2); EXPECT_FALSE(res.valid); EXPECT_THAT(res.message, HasSubstr("Different Constant values detected")); @@ -776,13 +736,10 @@ TEST(TransformationTests, ConstantComparison_ElementTypeU1_Negative_9thbit) { const uint8_t data1[2] = {0x00, 0x80}; // 0000 0000 1000 0000 const uint8_t data2[2] = {0x00, 0x00}; // 0000 0000 0000 0000 - const auto& f1 = - createU1ConstantFunc(shape, static_cast(data1)); - const auto& f2 = - createU1ConstantFunc(shape, static_cast(data2)); + const auto& f1 = createU1ConstantFunc(shape, static_cast(data1)); + const auto& f2 = createU1ConstantFunc(shape, static_cast(data2)); - const auto fc = FunctionsComparator::with_default().enable( - FunctionsComparator::CONST_VALUES); + const auto fc = FunctionsComparator::with_default().enable(FunctionsComparator::CONST_VALUES); const auto res = fc.compare(f1, f2); EXPECT_FALSE(res.valid); EXPECT_THAT(res.message, HasSubstr("Different Constant values detected")); diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp index e04435284c8..14b49fce06a 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/matchers/single_op.cpp @@ -70,8 +70,7 @@ bool compare_constants_data(const std::shared_ptr &op, bool SingleOpMatcher::same_op_type(const std::shared_ptr &node, const std::shared_ptr &ref, const LayerTestsUtils::OPInfo &op_info) const { - return node->get_type_info().name == ref->get_type_info().name && - node->get_type_info().version == ref->get_type_info().version; + return node->get_type_info() == ref->get_type_info(); } bool SingleOpMatcher::match_inputs(const std::shared_ptr &node, @@ -195,4 +194,4 @@ SingleOpMatcher::SingleOpMatcher() { ov::op::v1::GroupConvolution, ov::op::v1::GroupConvolutionBackpropData>>(true) }; -} \ No newline at end of file +} diff --git a/src/tests/functional/plugin/myriad/ngraph/conversions/dynamic_shape_resolver.cpp b/src/tests/functional/plugin/myriad/ngraph/conversions/dynamic_shape_resolver.cpp index b6ce2ca835e..cbf87d00ca3 100644 --- a/src/tests/functional/plugin/myriad/ngraph/conversions/dynamic_shape_resolver.cpp +++ b/src/tests/functional/plugin/myriad/ngraph/conversions/dynamic_shape_resolver.cpp @@ -23,9 +23,9 @@ public: void SetUp() override { const auto tensorType = ngraph::element::f16; const auto shapeType = ngraph::element::i64; - const auto tensorShape = std::initializer_list{1, 800}; + const ov::Shape tensorShape{1, 800}; - const auto tensor = std::make_shared(tensorType, ngraph::Shape{tensorShape}); + const auto tensor = std::make_shared(tensorType, tensorShape); const auto shape = std::make_shared(shapeType, ngraph::Shape{tensorShape.size()}); auto dynamicShapeResolver = std::make_shared(tensor, shape); dynamicShapeResolver->set_friendly_name(s_FriendlyName); diff --git a/src/tests/ngraph_helpers/ngraph_functions/src/utils/ngraph_helpers.cpp b/src/tests/ngraph_helpers/ngraph_functions/src/utils/ngraph_helpers.cpp index 1eb815c60ba..1798846bd1a 100644 --- a/src/tests/ngraph_helpers/ngraph_functions/src/utils/ngraph_helpers.cpp +++ b/src/tests/ngraph_helpers/ngraph_functions/src/utils/ngraph_helpers.cpp @@ -278,7 +278,9 @@ std::vector>> getCons namespace { std::string toString(const NodeTypeInfo& typeInfo) { + OPENVINO_SUPPRESS_DEPRECATED_START return std::string(typeInfo.name) + " ver. " + std::to_string(typeInfo.version); + OPENVINO_SUPPRESS_DEPRECATED_END } void CompareShapes(const PartialShape& actual, const PartialShape& expected) { @@ -339,7 +341,9 @@ std::shared_ptr getNodeSharedPtr(const ngraph::NodeTypeInfo &type_ ngraphNode->validate_and_infer_types(); return ngraphNode; } + OPENVINO_SUPPRESS_DEPRECATED_START NGRAPH_UNREACHABLE("supported opsets does not contain op with name: ", type_info.name, " version: ", type_info.version); + OPENVINO_SUPPRESS_DEPRECATED_END } bool is_tensor_iterator_exist(const std::shared_ptr & func) {