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

Method ShowInternal

tensorflow/core/profiler/internal/tfprof_scope.cc:80–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80const ShowNode* TFScope::ShowInternal(const Options& opts, Timeline* timeline) {
81 root_->ResetTotalStats();
82 if (opts.output_type == kOutput[3]) {
83 fprintf(stderr, "Only 'code' view supports pprof output now.\n");
84 return root_;
85 }
86
87 std::vector<ScopeNode*> roots = Account(root_->children, opts);
88 root_->show_children.clear();
89 for (ScopeNode* n : roots) {
90 root_->AggregateTotalStats(n);
91 }
92
93 if (opts.start_name_regexes.size() != 1 ||
94 opts.start_name_regexes[0] != ".*") {
95 roots = SearchRoot(roots, opts.start_name_regexes);
96 }
97
98 root_->show_children.assign(roots.begin(), roots.end());
99 ScopeNode* root = PrintScope({root_}, opts, 1, 0)[0];
100
101 root->formatted_str = FormatLegend(opts) + root->formatted_str;
102 Format(root->show_children, &root->formatted_str, root->mutable_proto());
103
104 if (timeline) {
105 timeline->GenerateScopeTimeline(root);
106 }
107 return root;
108}
109
110void TFScope::Format(const std::vector<ScopeNode*> roots, string* display_str,
111 GraphNodeProto* proto) {

Callers

nothing calls this directly

Calls 10

ResetTotalStatsMethod · 0.80
AggregateTotalStatsMethod · 0.80
GenerateScopeTimelineMethod · 0.80
FormatEnum · 0.50
clearMethod · 0.45
sizeMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
mutable_protoMethod · 0.45

Tested by

no test coverage detected