Bypass the given subgraph by connecting its inputs to its outputs. Args: sgv: the subgraph view to be bypassed. This argument is converted to a subgraph using the same rules than the function subgraph.make_view. Note that sgv is modified in place. Returns: A tuple `(sgv, det
(sgv)
| 199 | |
| 200 | |
| 201 | def bypass(sgv): |
| 202 | """Bypass the given subgraph by connecting its inputs to its outputs. |
| 203 | |
| 204 | Args: |
| 205 | sgv: the subgraph view to be bypassed. This argument is converted to a |
| 206 | subgraph using the same rules than the function subgraph.make_view. |
| 207 | Note that sgv is modified in place. |
| 208 | Returns: |
| 209 | A tuple `(sgv, detached_inputs)` where: |
| 210 | `sgv` is a new subgraph view of the bypassed subgraph; |
| 211 | `detached_inputs` is a list of the created input placeholders. |
| 212 | Raises: |
| 213 | StandardError: if sgv cannot be converted to a SubGraphView using |
| 214 | the same rules than the function subgraph.make_view. |
| 215 | """ |
| 216 | # TODO(fkp): allows to plug sgv.inputs to individual sgv.outputs consumers |
| 217 | sgv = subgraph.make_view(sgv) |
| 218 | sgv_inputs = list(sgv.inputs) |
| 219 | sgv, detached_inputs = detach_inputs(sgv) |
| 220 | reroute.reroute_ts(sgv_inputs, sgv.outputs) |
| 221 | return sgv, detached_inputs |
nothing calls this directly
no test coverage detected