| 62 | }; |
| 63 | |
| 64 | void MoveOutgoingEdges(Graph* g, Node* old_node, Node* new_node) { |
| 65 | std::vector<const Edge*> out_edges(old_node->out_edges().begin(), |
| 66 | old_node->out_edges().end()); |
| 67 | for (const Edge* edge : out_edges) { |
| 68 | // TODO(sanjoy): This does not update NodeDef inputs. To be able to update |
| 69 | // NodeDef inputs we first need to fix encapsulate_subgraphs_pass to fix up |
| 70 | // the NodeDef inputs to the function call nodes. |
| 71 | g->AddEdge(new_node, edge->src_output(), edge->dst(), edge->dst_input()); |
| 72 | g->RemoveEdge(edge); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // Returns a data value that is dead iff `control` is dead. |
| 77 | Output ControlToData(const Scope& scope, Node* control) { |
no test coverage detected