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

Function LogDump

tensorflow/lite/toco/tooling_util.cc:584–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582}
583
584void LogDump(int log_level, const string& message, const Model& model) {
585 namespace port = toco::port;
586 const auto& dump_options = *GraphVizDumpOptions::singleton();
587
588 DumpGraphvizVideoFrame(model);
589 if (!dump_options.dump_graphviz.empty()) {
590 string graphviz_dump;
591
592 DumpGraphviz(model, &graphviz_dump, message);
593 const auto result = port::file::SetContents(
594 port::file::JoinPath(
595 dump_options.dump_graphviz,
596 absl::StrCat("toco_", absl::StrReplaceAll(message, {{" ", "_"}}),
597 ".dot")),
598 graphviz_dump, port::file::Defaults());
599 QCHECK(result.ok()) << result.error_message();
600 }
601
602 if (!VLOG_IS_ON(log_level)) {
603 return;
604 }
605 VLOG(log_level) << "BEGIN DUMP OF TOCO MODEL (" << message << ")";
606 LogSummary(log_level, model);
607 std::unordered_set<string> already_printed_arrays;
608 for (const auto& op : model.operators) {
609 for (const auto& input : op->inputs) {
610 if (!already_printed_arrays.count(input)) {
611 already_printed_arrays.insert(input);
612 LogArray(log_level, model, input);
613 }
614 }
615 VLOG(log_level) << HelpfulOperatorTypeName(*op) << " :";
616 VLOG(log_level) << " " << FormatArraysList(model, op->inputs) << " -> "
617 << FormatArraysList(model, op->outputs);
618 if (op->fused_activation_function != FusedActivationFunctionType::kNone) {
619 VLOG(log_level) << " (with fused activation function)";
620 }
621 for (const auto& output : op->outputs) {
622 if (!already_printed_arrays.count(output)) {
623 already_printed_arrays.insert(output);
624 LogArray(log_level, model, output);
625 }
626 }
627 }
628 VLOG(log_level) << "END DUMP OF TOCO MODEL (" << message << ")";
629}
630
631// Note remaining raw-array extension in ProcessTensorFlowReshapeOperator().
632void ExtendShape(Shape* shape, int new_shape_size) {

Callers 2

ImportFunction · 0.85
TransformWithStatusFunction · 0.85

Calls 14

DumpGraphvizVideoFrameFunction · 0.85
DumpGraphvizFunction · 0.85
SetContentsFunction · 0.85
DefaultsFunction · 0.85
LogSummaryFunction · 0.85
LogArrayFunction · 0.85
HelpfulOperatorTypeNameFunction · 0.85
FormatArraysListFunction · 0.85
JoinPathFunction · 0.70
StrCatFunction · 0.50
emptyMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected