| 639 | } |
| 640 | |
| 641 | void DumpNode(const Model& model, string* output_file, const string& node_name, |
| 642 | Node const& node) { |
| 643 | bool not_root = !node_name.empty(); |
| 644 | if (not_root) { |
| 645 | DumpSubgraphHeader(output_file, node, node_name); |
| 646 | } |
| 647 | |
| 648 | for (const auto& child : node.children) { |
| 649 | if (!child.second->array_id.empty()) { |
| 650 | // Dump array if this node posesses one. |
| 651 | DumpArray(model, output_file, child.second->array_id); |
| 652 | } |
| 653 | // Note that it is always possible to have children. Unlike a filesystem, |
| 654 | // the existence of array "foo/bar" does _not_ prevent other arrays, such as |
| 655 | // and "foo/bar/baz", from being nested beneath it. |
| 656 | DumpNode(model, output_file, child.first, *child.second); |
| 657 | } |
| 658 | |
| 659 | if (not_root) { |
| 660 | // End subgraph |
| 661 | AppendF(output_file, " }\n"); |
| 662 | } |
| 663 | } |
| 664 | |
| 665 | int64 GetArithmeticOpsCount(const Model& model, const string& array_id) { |
| 666 | for (const auto& op : model.operators) { |
no test coverage detected