MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / GenScopeTreeDebugInfo

Function GenScopeTreeDebugInfo

paddle/fluid/framework/scope.cc:276–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276std::string GenScopeTreeDebugInfo(Scope* root) {
277 std::stringstream os;
278
279 if (!root) return "";
280
281 // level traversal
282 std::queue<Scope*> queue;
283 queue.push(root);
284
285 std::vector<Scope*> scopes;
286
287 while (!queue.empty()) {
288 auto* end = queue.back();
289 Scope* q = nullptr;
290 while (q != end) {
291 q = queue.front();
292 queue.pop();
293 os << q << " ";
294 scopes.push_back(q);
295
296 for (auto* c : q->kids()) {
297 queue.push(c);
298 }
299 }
300 // end of a level
301 os << "\n------------------------------------------\n";
302 }
303
304 os << "\nDetails:\n\n";
305
306 for (Scope* q : scopes) {
307 os << "====\n";
308 os << q << ":\n";
309 for (auto& var : q->LocalVarNames()) {
310 os << " - " << var << "\n";
311 }
312 }
313
314 return os.str();
315}
316
317} // namespace paddle::framework

Callers 7

BuildScopeFunction · 0.85
RunProgramImplFunction · 0.85
RunProgramGradImplFunction · 0.85
LegacyRunProgramImplFunction · 0.85
LegacyRunProgramGradImplFunction · 0.85
PredictorEngineMethod · 0.85
InterpreterEngineMethod · 0.85

Calls 8

LocalVarNamesMethod · 0.80
pushMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
frontMethod · 0.45
popMethod · 0.45
push_backMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected