Fix non determinism inside Serialization (#5743)
This commit is contained in:
parent
e3b4037b69
commit
2f95d25205
@ -753,15 +753,22 @@ void ngfunction_2_irv10(pugi::xml_node& netXml,
|
||||
port.append_attribute("id").set_value(port_id++);
|
||||
port.append_attribute("precision")
|
||||
.set_value(get_precision_name(o.get_element_type()).c_str());
|
||||
|
||||
// Sort tensor names
|
||||
const auto & tensor_names = o.get_tensor().get_names();
|
||||
std::vector<std::string> vector_names(tensor_names.begin(), tensor_names.end());
|
||||
sort(vector_names.begin(), vector_names.end());
|
||||
|
||||
std::string names;
|
||||
for (const auto& name : o.get_tensor().get_names()) {
|
||||
for (const auto& name : vector_names) {
|
||||
if (!names.empty())
|
||||
names += ", ";
|
||||
names += ",";
|
||||
names += escape_delim(name);
|
||||
}
|
||||
if (!names.empty()) {
|
||||
port.append_attribute("names").set_value(names.c_str());
|
||||
}
|
||||
|
||||
for (auto d : o.get_shape()) {
|
||||
pugi::xml_node dim = port.append_child("dim");
|
||||
dim.append_child(pugi::xml_node_type::node_pcdata)
|
||||
|
Loading…
Reference in New Issue
Block a user