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

Method Format

tensorflow/core/profiler/internal/tfprof_code.cc:523–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523void TFCode::Format(const CodeNode* root, const std::vector<CodeNode*>& nodes,
524 const Options& opts, string* display_str,
525 MultiGraphNodeProto* proto, std::vector<uint64>* call_ids) {
526 if (nodes.empty() && root->has_trace() && opts.output_type == kOutput[3]) {
527 pprof_profile_->AddSample(root, call_ids);
528 }
529
530 for (CodeNode* node : nodes) {
531 if (root->has_trace() && opts.output_type == kOutput[3]) {
532 uint64 loc_id = pprof_profile_->AddLocation(node, root);
533 call_ids->push_back(loc_id);
534 }
535 display_str->append(node->formatted_str);
536 MultiGraphNodeProto* child = proto->add_children();
537 child->MergeFrom(node->proto());
538 Format(node, node->show_children, opts, display_str, child, call_ids);
539 if (root->has_trace() && opts.output_type == kOutput[3]) {
540 call_ids->pop_back();
541 }
542 }
543}
544
545std::vector<CodeNode*> TFCode::SearchRoot(std::vector<CodeNode*> roots,
546 const std::vector<string>& regexes) {

Callers 1

UpdateMethod · 0.45

Calls 9

has_traceMethod · 0.80
AddSampleMethod · 0.80
AddLocationMethod · 0.80
protoMethod · 0.80
pop_backMethod · 0.80
FormatEnum · 0.50
emptyMethod · 0.45
push_backMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected