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

Method CollateResult

tensorflow/core/grappler/graph_analyzer/graph_analyzer.cc:278–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278Status GraphAnalyzer::CollateResult() {
279 ordered_collation_.clear();
280 collation_map_.clear();
281
282 // Collate by the signatures of the graphs.
283 for (const auto& it : result_) {
284 auto sig = absl::make_unique<Signature>();
285 it->ExtractForSignature(&sig->map);
286 Status status = sig->Compute();
287 if (!status.ok()) {
288 return status;
289 }
290
291 auto& coll_entry = collation_map_[sig.get()];
292 if (coll_entry.sig == nullptr) {
293 coll_entry.sig = std::move(sig);
294 }
295 ++coll_entry.count;
296 }
297
298 // Then order them by the count.
299 for (auto& entry : collation_map_) {
300 ordered_collation_.insert(&entry.second);
301 }
302
303 result_.clear(); // Not needed after collation.
304
305 return Status::OK();
306}
307
308std::vector<string> GraphAnalyzer::DumpRawSubgraphs() {
309 std::vector<string> result;

Callers

nothing calls this directly

Calls 6

ExtractForSignatureMethod · 0.80
clearMethod · 0.45
ComputeMethod · 0.45
okMethod · 0.45
getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected