MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DumpLinkHashMap

Function DumpLinkHashMap

tensorflow/core/grappler/graph_analyzer/test_tools.cc:105–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105std::vector<string> DumpLinkHashMap(const SigNode::LinkHashMap& link_hash_map) {
106 // The entries in this map are ordered by hash value which might change
107 // at any point. Re-order them by the link tag.
108 std::map<SigNode::LinkTag, size_t> tags;
109 for (const auto& entry : link_hash_map) {
110 tags[entry.second.tag] = entry.first;
111 }
112
113 std::vector<string> result;
114 for (const auto& id : tags) {
115 // For predictability, the nodes need to be sorted.
116 std::vector<string> nodes;
117 for (const auto& peer : link_hash_map.at(id.second).peers) {
118 nodes.emplace_back(peer->name());
119 }
120 std::sort(nodes.begin(), nodes.end());
121 result.emplace_back(string(id.first.local) + ":" + string(id.first.remote) +
122 ": " + absl::StrJoin(nodes, ", "));
123 }
124 return result;
125}
126
127std::vector<string> DumpHashedPeerVector(
128 const SigNode::HashedPeerVector& hashed_peers) {

Callers 1

TESTFunction · 0.85

Calls 6

sortFunction · 0.85
nameMethod · 0.65
atMethod · 0.45
emplace_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected