From 02aa4a1f1f28ea05f641321a22f29bc8e194178e Mon Sep 17 00:00:00 2001 From: Tomasz Krupa Date: Wed, 4 Sep 2024 09:02:02 +0000 Subject: [PATCH] Adjust for weights path in serialization deterministicity tests --- .../pass/serialization/deterministicity.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/core/tests/pass/serialization/deterministicity.cpp b/src/core/tests/pass/serialization/deterministicity.cpp index 5bcfbf97b77890..6331075a9afd83 100644 --- a/src/core/tests/pass/serialization/deterministicity.cpp +++ b/src/core/tests/pass/serialization/deterministicity.cpp @@ -193,6 +193,12 @@ TEST_P(SerializationDeterministicityInputOutputTest, FromOvModel) { auto& expected1 = modelRef; ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1, irVersion).run_on_model(modelRef); auto expected2 = ov::test::readModel(m_out_xml_path_1, m_out_bin_path_1); + + // We need to check and erase this entry because it's expected to be different in these two scenarios. + std::string path_key = "weights_path"; + EXPECT_EQ(m_out_bin_path_1, expected2->get_rt_info()[path_key].as()); + expected2->get_rt_info().erase(path_key); + ov::pass::Serialize(m_out_xml_path_2, m_out_bin_path_2, irVersion).run_on_model(expected2); EXPECT_EQ(input0Name, expected1->input(0).get_node()->get_friendly_name()); @@ -276,9 +282,22 @@ TEST_P(SerializationDeterministicityInputOutputTest, FromIrModel) { xmlFile.close(); } + std::string path_key = "weights_path"; + auto expected1 = ov::test::readModel(xmlFileName, ""); + + // We need to check and erase this entry because it's expected to be different in these two scenarios. + EXPECT_EQ("", expected1->get_rt_info()[path_key].as()); + expected1->get_rt_info().erase(path_key); + ov::pass::Serialize(m_out_xml_path_1, "", irVersion).run_on_model(expected1); + auto expected2 = ov::test::readModel(m_out_xml_path_1, ""); + + // We need to check and erase this entry because it's expected to be different in these two scenarios. + EXPECT_EQ(m_out_bin_path_1, expected2->get_rt_info()[path_key].as()); + expected2->get_rt_info().erase(path_key); + ov::pass::Serialize(m_out_xml_path_2, "", irVersion).run_on_model(expected2); EXPECT_EQ(input0Name, expected1->input(0).get_node()->get_friendly_name());