Detach all the external control inputs of the subgraph sgv. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view.
(sgv)
| 36 | |
| 37 | |
| 38 | def detach_control_inputs(sgv): |
| 39 | """Detach all the external control inputs of the subgraph sgv. |
| 40 | |
| 41 | Args: |
| 42 | sgv: the subgraph view to be detached. This argument is converted to a |
| 43 | subgraph using the same rules as the function subgraph.make_view. |
| 44 | """ |
| 45 | sgv = subgraph.make_view(sgv) |
| 46 | for op in sgv.ops: |
| 47 | cops = [cop for cop in op.control_inputs if cop not in sgv.ops] |
| 48 | reroute.remove_control_inputs(op, cops) |
| 49 | |
| 50 | |
| 51 | def detach_control_outputs(sgv, control_outputs): |