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

Method CopyLinksPass2

tensorflow/core/grappler/graph_analyzer/sig_node.cc:67–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void SigNode::CopyLinksPass2(std::map<LinkTag, Link>* link_map) {
68 for (auto& entry : *link_map) {
69 Link* hl_entry_ptr = &hash_to_link_[entry.second.unique_hash];
70 // In case of a conflict, rehash. This should almost never happen.
71 // Because the order of iteration is predictable, the rehashed values
72 // will also be predictable.
73 while (!hl_entry_ptr->peers.empty()) {
74 CombineHash(1, &entry.second.unique_hash);
75 hl_entry_ptr = &hash_to_link_[entry.second.unique_hash];
76 }
77
78 for (const auto& peer : entry.second.peers) {
79 hashed_peers_.emplace_back(HashedPeer(entry.second.unique_hash, peer));
80 }
81
82 hl_entry_ptr->tag = entry.second.tag;
83 hl_entry_ptr->unique_hash = entry.second.unique_hash;
84 hl_entry_ptr->peers.swap(entry.second.peers);
85 }
86}
87
88void SigNode::ComputeTopoHash0() {
89 topo_hash_.clear();

Callers

nothing calls this directly

Calls 5

CombineHashFunction · 0.85
HashedPeerClass · 0.85
emptyMethod · 0.45
emplace_backMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected