| 754 | } // namespace |
| 755 | |
| 756 | void DumpGraphviz(const Model& model, string* output_file, |
| 757 | const string& graph_name) { |
| 758 | // Start graphviz format |
| 759 | AppendF(output_file, kGraphFmt, GetGraphLabel(model, graph_name)); |
| 760 | |
| 761 | // Organize arrays into a tree for subgraphing |
| 762 | Node tree; |
| 763 | BuildArrayTree(model, &tree); |
| 764 | DumpNode(model, output_file, "", tree); |
| 765 | |
| 766 | // Dump edges outside all subgraphs (otherwise the referred-to nodes are |
| 767 | // implicitly included in that subgraph). |
| 768 | for (int op_index = 0; op_index < model.operators.size(); op_index++) { |
| 769 | DumpOperatorEdges(model, output_file, op_index); |
| 770 | } |
| 771 | |
| 772 | // Dump RNN Backedges |
| 773 | for (const auto& rnn_state : model.flags.rnn_states()) { |
| 774 | AppendF(output_file, kRNNBackEdgeFmt, rnn_state.back_edge_source_array(), |
| 775 | rnn_state.state_array()); |
| 776 | } |
| 777 | // End graphviz format |
| 778 | AppendF(output_file, "}\n"); |
| 779 | } |
| 780 | } // namespace toco |
no test coverage detected