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

Method Compute

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

Source from the content-addressed store, hash-verified

219}
220
221Status Signature::Compute() {
222 if (map.size() > kMaxGraphSize) {
223 return Status(
224 error::INVALID_ARGUMENT,
225 absl::StrFormat(
226 "A graph of %d nodes is too big for signature computation, "
227 "the maximal supported node count is %d.",
228 map.size(), kMaxGraphSize));
229 }
230
231 // The value that will be assigned next as the unique node id.
232 // This also means that all the entries in nodes at indexes less than this
233 // have been finalized and don't need to be touched any more.
234 size_t next_node_id = 0;
235
236 sig_short = 0;
237 sig_full.resize(0); // Keep the storage.
238
239 // The main signature generation.
240 PrepareNodes();
241 FindUniqueHashes(&next_node_id);
242 while (next_node_id < map.size()) {
243 ComputeOneRound(next_node_id);
244 FindUniqueHashes(&next_node_id);
245 }
246
247 OrderLinks();
248
249 return Status::OK();
250}
251
252void Signature::PrepareNodes() {
253 nodes.resize(0); // Keep the storage.

Callers 4

TestGraphEveryWayMethod · 0.45
TEST_FFunction · 0.45
CollateResultMethod · 0.45
EvaluateNodeFunction · 0.45

Calls 3

StatusClass · 0.50
sizeMethod · 0.45
resizeMethod · 0.45

Tested by 2

TestGraphEveryWayMethod · 0.36
TEST_FFunction · 0.36