MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _reroute_sgv

Function _reroute_sgv

tensorflow/contrib/graph_editor/reroute.py:370–391  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

368
369
370def _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
394def swap_inputs(sgv0, sgv1):

Callers 2

swap_iosFunction · 0.85
reroute_iosFunction · 0.85

Calls 2

_reroute_sgv_outputsFunction · 0.85
_reroute_sgv_inputsFunction · 0.85

Tested by

no test coverage detected