| 92 | } |
| 93 | |
| 94 | void Subgraph::ExtractForSignature(SigNodeMap* result) { |
| 95 | // Mapping of nodes from the original graph to the new one. |
| 96 | SigNode::TranslationMap full_to_new; |
| 97 | |
| 98 | for (auto node : id_) { |
| 99 | auto newnode_ref = absl::make_unique<SigNode>(node->node_def()); |
| 100 | auto newnode = newnode_ref.get(); |
| 101 | (*result)[node->name()] = std::move(newnode_ref); |
| 102 | full_to_new[node] = newnode; |
| 103 | } |
| 104 | |
| 105 | for (const auto& mapping : full_to_new) { |
| 106 | mapping.second->CopyLinks(*mapping.first, full_to_new); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | //=== Subgraph |
| 111 | |