ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::dumper::text Namespace Reference

Functions

std::string formatOperandBrief (ir::OperandIndex ind)
 
std::string formatOperand (const ir::Graph &, ir::OperandIndex ind)
 
std::string formatOperation (const ir::IOperation &op, ir::OperationIndex ind)
 
std::string formatOperation (const ir::Graph &graph, ir::OperationIndex ind)
 
void dumpGraph (const ir::Graph &graph)
 
void dumpLoweredGraph (const compiler::LoweredGraph &lgraph)
 
void dumpLoweredGraph (const compiler::train::LoweredTrainableGraph &lgraph)
 

Function Documentation

◆ dumpGraph()

void onert::dumper::text::dumpGraph ( const ir::Graph graph)

Definition at line 75 of file GraphDumper.cc.

76{
77 VERBOSE(GraphDumper) << "{\n";
78 auto ops_topol = graph.topolSortOperations();
79 for (auto &&op_ind : ops_topol)
80 {
81 const auto &op = graph.operations().at(op_ind);
82 VERBOSE(GraphDumper) << " " << formatOperation(op, op_ind) << "\n";
83 }
84 graph.operands().iterate([&](const ir::OperandIndex &idx, const ir::Operand &oprd) {
85 VERBOSE(GraphDumper) << " Origin(" << idx << "): " << oprd.originIndex() << std::endl;
86 });
87 VERBOSE(GraphDumper) << "}\n";
88}
OriginIndex originIndex() const
Definition Operand.h:106
#define VERBOSE(name, lv)
Definition Log.h:71
std::string formatOperation(const ir::IOperation &op, ir::OperationIndex ind)

References formatOperation(), onert::ir::Operand::originIndex(), and VERBOSE.

Referenced by dumpLoweredGraph(), and dumpLoweredGraph().

◆ dumpLoweredGraph() [1/2]

void onert::dumper::text::dumpLoweredGraph ( const compiler::LoweredGraph lgraph)

Definition at line 90 of file GraphDumper.cc.

91{
92 // TODO Graph dump with backend info
93 dumpGraph(lgraph.graph());
94}
ir::Graph & graph() override

References dumpGraph(), and onert::compiler::LoweredGraph::graph().

◆ dumpLoweredGraph() [2/2]

void onert::dumper::text::dumpLoweredGraph ( const compiler::train::LoweredTrainableGraph lgraph)

Definition at line 96 of file GraphDumper.cc.

97{
98 // TODO Graph dump with backend info
99 dumpGraph(lgraph.graph());
100}

References dumpGraph(), and onert::compiler::train::LoweredTrainableGraph::graph().

◆ formatOperand()

std::string onert::dumper::text::formatOperand ( const ir::Graph ,
ir::OperandIndex  ind 
)

Definition at line 48 of file GraphDumper.cc.

49{
50 std::stringstream ss;
51 ss << ind;
52 // TODO Print shape, type and maybe more
53 return ss.str();
54}

◆ formatOperandBrief()

std::string onert::dumper::text::formatOperandBrief ( ir::OperandIndex  ind)

Definition at line 41 of file GraphDumper.cc.

42{
43 std::stringstream ss;
44 ss << ind;
45 return ss.str();
46}

◆ formatOperation() [1/2]

std::string onert::dumper::text::formatOperation ( const ir::Graph graph,
ir::OperationIndex  ind 
)

Definition at line 68 of file GraphDumper.cc.

69{
70 std::stringstream ss;
71 const auto &op = graph.operations().at(ind);
72 return formatOperation(op, ind);
73}

References formatOperation().

◆ formatOperation() [2/2]

std::string onert::dumper::text::formatOperation ( const ir::IOperation op,
ir::OperationIndex  ind 
)

Definition at line 56 of file GraphDumper.cc.

57{
58 std::stringstream ss;
59
60 ss << formatOperandIndexSequence(op.getOutputs());
61 ss << " = ";
62 ss << ind << "_" << op.name() << "(";
63 ss << formatOperandIndexSequence(op.getInputs());
64 ss << ")";
65 return ss.str();
66}
virtual const OperandIndexSequence & getInputs() const =0
virtual const OperandIndexSequence & getOutputs() const =0
virtual std::string name() const
Definition IOperation.h:36

References onert::ir::IOperation::getInputs(), onert::ir::IOperation::getOutputs(), and onert::ir::IOperation::name().

Referenced by onert::compiler::Linear::dump(), dumpGraph(), and formatOperation().