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

Method PrepareNodes

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

Source from the content-addressed store, hash-verified

250}
251
252void Signature::PrepareNodes() {
253 nodes.resize(0); // Keep the storage.
254
255 // Initialize the nodes.
256 int64_t mask = 1;
257 for (const auto& entry : map) {
258 SigNode* node = entry.second.get();
259 node->last_hashed_nodes_ = node->node_mask_ = mask;
260 mask <<= 1;
261 node->unique_rank_ = ~0;
262 node->hash_is_final_ = false;
263 node->ComputeTopoHash0();
264 if (node->GetHighTopoHash() <= map.size()) {
265 // Would conflict with one of the reserved values.
266 node->ReHighTopoHash();
267 }
268
269 // The initial order is random.
270 nodes.emplace_back(node);
271 }
272}
273
274void Signature::FindUniqueHashes(size_t* next_node_id_p) {
275 // Start by sorting by the hash value.

Callers

nothing calls this directly

Calls 7

resizeMethod · 0.45
getMethod · 0.45
ComputeTopoHash0Method · 0.45
GetHighTopoHashMethod · 0.45
sizeMethod · 0.45
ReHighTopoHashMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected