Re-route both the inputs and the outputs of the two subgraph views. This involves swapping all the inputs/outputs of the two subgraph views. Args: sgv0: the first subgraph to be swapped. This argument is converted to a subgraph using the same rules than the function subgraph.make_vie
(sgv0, sgv1, mode)
| 368 | |
| 369 | |
| 370 | def _reroute_sgv(sgv0, sgv1, mode): |
| 371 | """Re-route both the inputs and the outputs of the two subgraph views. |
| 372 | |
| 373 | This involves swapping all the inputs/outputs of the two subgraph views. |
| 374 | |
| 375 | Args: |
| 376 | sgv0: the first subgraph to be swapped. This argument is converted to a |
| 377 | subgraph using the same rules than the function subgraph.make_view. |
| 378 | sgv1: the second subgraph to be swapped. This argument is converted to a |
| 379 | subgraph using the same rules than the function subgraph.make_view. |
| 380 | mode: reroute mode, see _reroute_ts(...). |
| 381 | Returns: |
| 382 | A tuple `(sgv0, sgv1)` of subgraph views with their outputs and inputs |
| 383 | swapped. |
| 384 | Note that the function argument sgv0 and sgv1 are also modified in place. |
| 385 | Raises: |
| 386 | StandardError: if sgv0 or sgv1 cannot be converted to a SubGraphView using |
| 387 | the same rules than the function subgraph.make_view. |
| 388 | """ |
| 389 | _reroute_sgv_outputs(sgv0, sgv1, mode) |
| 390 | _reroute_sgv_inputs(sgv0, sgv1, mode) |
| 391 | return sgv0, sgv1 |
| 392 | |
| 393 | |
| 394 | def swap_inputs(sgv0, sgv1): |
no test coverage detected