Skip to content

Commit

Permalink
Adjust for weights path in serialization deterministicity tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkrupa-intel committed Sep 4, 2024
1 parent 247fe60 commit 02aa4a1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/core/tests/pass/serialization/deterministicity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>());
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());
Expand Down Expand Up @@ -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<std::string>());
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<std::string>());
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());
Expand Down

0 comments on commit 02aa4a1

Please sign in to comment.