Re-route all the outputs of two operations. Args: sgv0: the first subgraph to have its outputs swapped. This argument is converted to a subgraph using the same rules than the function subgraph.make_view. sgv1: the second subgraph to have its outputs swapped. This argument is
(sgv0, sgv1, mode)
| 342 | |
| 343 | |
| 344 | def _reroute_sgv_outputs(sgv0, sgv1, mode): |
| 345 | """Re-route all the outputs of two operations. |
| 346 | |
| 347 | Args: |
| 348 | sgv0: the first subgraph to have its outputs swapped. This argument is |
| 349 | converted to a subgraph using the same rules than the function |
| 350 | subgraph.make_view. |
| 351 | sgv1: the second subgraph to have its outputs swapped. This argument is |
| 352 | converted to a subgraph using the same rules than the function |
| 353 | subgraph.make_view. |
| 354 | mode: reroute mode, see _reroute_ts(...). |
| 355 | Returns: |
| 356 | A tuple `(sgv0, sgv1)` of subgraph views with their outputs swapped. |
| 357 | Note that the function argument sgv0 and sgv1 are also modified in place. |
| 358 | Raises: |
| 359 | StandardError: if sgv0 or sgv1 cannot be converted to a SubGraphView using |
| 360 | the same rules than the function subgraph.make_view. |
| 361 | """ |
| 362 | sgv0 = _subgraph.make_view(sgv0) |
| 363 | sgv1 = _subgraph.make_view(sgv1) |
| 364 | _util.check_graphs(sgv0, sgv1) |
| 365 | cannot_modify = sgv0.ops + sgv1.ops |
| 366 | _reroute_ts(sgv0.outputs, sgv1.outputs, mode, cannot_modify=cannot_modify) |
| 367 | return sgv0, sgv1 |
| 368 | |
| 369 | |
| 370 | def _reroute_sgv(sgv0, sgv1, mode): |
no test coverage detected