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

Method Account

tensorflow/core/profiler/internal/tfprof_graph.cc:213–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213std::vector<GraphNode*> TFGraph::Account(const std::vector<GraphNode*>& roots,
214 const Options& opts,
215 std::set<string>* visits) {
216 std::vector<GraphNode*> act_nodes;
217 for (GraphNode* node : roots) {
218 if (visits->find(node->name()) != visits->end()) continue;
219 visits->insert(node->name());
220 // Depth-first.
221 std::vector<GraphNode*> act_cnodes = Account(node->children, opts, visits);
222
223 node->account = ReAccount(node, opts);
224 if (node->account) {
225 node->show_children.clear();
226 node->ResetTotalStats();
227 node->AddSelfToTotalStats();
228 // Aggregate its accounted children stats.
229 for (GraphNode* c : act_cnodes) {
230 node->AggregateTotalStats(c);
231 node->show_children.push_back(c);
232 }
233 act_nodes.push_back(node);
234 } else {
235 // If the current node is not accounted, pass the children to the
236 // ancestor.
237 act_nodes.insert(act_nodes.end(), act_cnodes.begin(), act_cnodes.end());
238 }
239 }
240 return act_nodes;
241}
242} // namespace tfprof
243} // namespace tensorflow

Callers

nothing calls this directly

Calls 10

ResetTotalStatsMethod · 0.80
AddSelfToTotalStatsMethod · 0.80
AggregateTotalStatsMethod · 0.80
nameMethod · 0.65
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected