diff --git a/src/common/transformations/include/transformations/rt_info/attributes.hpp b/src/common/transformations/include/transformations/rt_info/attributes.hpp index 04017c456a4d83..ef23670c8152ef 100644 --- a/src/common/transformations/include/transformations/rt_info/attributes.hpp +++ b/src/common/transformations/include/transformations/rt_info/attributes.hpp @@ -30,12 +30,14 @@ class TRANSFORMATIONS_API Attributes { public: Attributes(); - Any create_by_type_info(const ov::DiscreteTypeInfo& type_info_name); + Any create_by_type_info(const ov::DiscreteTypeInfo& type_info_name) const; private: template void register_factory() { m_factory_registry.emplace(T::get_type_info_static(), []() -> Any { + // TODO add versioning deprecation notice - newer versions are not allowed + assert(T::get_type_info_static().get_version() == "0"); return T{}; }); } diff --git a/src/common/transformations/src/transformations/rt_info/attributes.cpp b/src/common/transformations/src/transformations/rt_info/attributes.cpp index 883c4ddda39d49..fd30f2ca0b8ef4 100644 --- a/src/common/transformations/src/transformations/rt_info/attributes.cpp +++ b/src/common/transformations/src/transformations/rt_info/attributes.cpp @@ -19,7 +19,7 @@ ov::pass::Attributes::Attributes() { register_factory(); } -ov::Any ov::pass::Attributes::create_by_type_info(const ov::DiscreteTypeInfo& type_info) { +ov::Any ov::pass::Attributes::create_by_type_info(const ov::DiscreteTypeInfo& type_info) const { auto it_type = m_factory_registry.find(type_info); if (it_type != m_factory_registry.end()) { return it_type->second(); diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp index 409dcad066d7a6..a9957281f6fd66 100644 --- a/src/core/src/pass/serialize.cpp +++ b/src/core/src/pass/serialize.cpp @@ -1016,7 +1016,10 @@ void ngfunction_2_ir(pugi::xml_node& netXml, auto& rt_attribute = item.second.as(); const auto& type_info = rt_attribute.get_type_info(); attribute_node.append_attribute("name").set_value(type_info.name); - attribute_node.append_attribute("version").set_value(type_info.get_version().c_str()); + // TODO add deprecation notice with explanation (RuntimeAttribute should not be versioned, 0 remains + // as legacy for backword compatibity) + assert(type_info.get_version() == "0"); + attribute_node.append_attribute("version").set_value("0"); rt_info::RTInfoSerializer serializer(attribute_node); if (!rt_attribute.visit_attributes(serializer)) { rt_node.remove_child(attribute_node); diff --git a/src/frontends/ir/src/ir_deserializer.cpp b/src/frontends/ir/src/ir_deserializer.cpp index 68900b150514bc..fa27bfdf950f1a 100644 --- a/src/frontends/ir/src/ir_deserializer.cpp +++ b/src/frontends/ir/src/ir_deserializer.cpp @@ -957,7 +957,7 @@ std::shared_ptr ov::XmlDeserializer::create_node(const std::vector if (!getStrAttribute(item, "name", attribute_name)) { @@ -965,12 +965,8 @@ std::shared_ptr ov::XmlDeserializer::create_node(const std::vector()) { diff --git a/tools/mo/openvino/tools/mo/utils/ir_engine/ir_engine.py b/tools/mo/openvino/tools/mo/utils/ir_engine/ir_engine.py index aec4049c6b32e8..667ac1e5b01ea5 100644 --- a/tools/mo/openvino/tools/mo/utils/ir_engine/ir_engine.py +++ b/tools/mo/openvino/tools/mo/utils/ir_engine/ir_engine.py @@ -540,7 +540,8 @@ def __read_old_api_map_element_type(attr, layer_type): @staticmethod def __read_rt_info_common(attr): attr_name = attr.attrib['name'] - version = int(attr.attrib['version']) + # TODO add notice why fixed to 0 + version = 0 rt_info = OrderedDict() for key in attr.attrib: if key not in ('name', 'version'):