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

Method BuildView

tensorflow/core/profiler/internal/tfprof_stats.cc:107–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void TFStats::BuildView(const string& cmd) {
108 if (cmd == kCmds[0] && !scope_view_) {
109 scope_view_.reset(new TFScope(ckpt_reader_.get()));
110 for (auto it = nodes_map_.begin(); it != nodes_map_.end(); it++) {
111 scope_view_->AddNode(it->second.get());
112 }
113 scope_view_->Build();
114 }
115 if (cmd == kCmds[1] && !graph_view_) {
116 graph_view_.reset(new TFGraph(ckpt_reader_.get()));
117 for (auto it = nodes_map_.begin(); it != nodes_map_.end(); it++) {
118 graph_view_->AddNode(it->second.get());
119 }
120 graph_view_->Build();
121 }
122 if (cmd == kCmds[2] && !code_view_) {
123 code_view_.reset(new TFCode());
124 for (auto it = nodes_map_.begin(); it != nodes_map_.end(); it++) {
125 code_view_->AddNode(it->second.get());
126 }
127 code_view_->Build();
128 }
129 if (cmd == kCmds[3] && !op_view_) {
130 op_view_.reset(new TFOp());
131 for (auto it = nodes_map_.begin(); it != nodes_map_.end(); it++) {
132 op_view_->AddNode(it->second.get());
133 }
134 op_view_->Build();
135 }
136}
137
138void TFStats::BuildAllViews() {
139 std::vector<string> cmds_str(kCmds, kCmds + sizeof(kCmds) / sizeof(*kCmds));

Callers 5

RunFunction · 0.80
RunProfileFunction · 0.80
ProfileGraphMethod · 0.80
ProfileNameScopeMethod · 0.80
ProfileOperationsMethod · 0.80

Calls 6

resetMethod · 0.45
getMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
AddNodeMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected