aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/graph_editor
diff options
context:
space:
mode:
authorGravatar Dan Ringwalt <ringwalt@google.com>2017-10-11 07:53:40 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-11 07:58:08 -0700
commit9e15937f966a83957552cc95c1e5baba2e16fa51 (patch)
treeb647e94de1af32587da3c93e331fba6c0126f4fc /tensorflow/contrib/graph_editor
parent13d6d3b51441d11dca141e1f17630b7448835f78 (diff)
Copy public tf.contrib.graph_editor.reroute_{inputs,outputs} docs.
There are multiple references "see reroute_inputs" which are unhelpful because the full docstring now only exists on _reroute_sgv_inputs (likewise for reroute_outputs). Copy most of the docstring to reroute_{inputs,outputs} so that it is outputted in the docs. Update some other dangling doc references from _reroute to _reroute_sgv, but that docstring will not be included the docs. PiperOrigin-RevId: 171821659
Diffstat (limited to 'tensorflow/contrib/graph_editor')
-rw-r--r--tensorflow/contrib/graph_editor/reroute.py40
1 files changed, 35 insertions, 5 deletions
diff --git a/tensorflow/contrib/graph_editor/reroute.py b/tensorflow/contrib/graph_editor/reroute.py
index 42968ae63b..7ffdbb7139 100644
--- a/tensorflow/contrib/graph_editor/reroute.py
+++ b/tensorflow/contrib/graph_editor/reroute.py
@@ -397,27 +397,57 @@ def swap_inputs(sgv0, sgv1):
def reroute_inputs(sgv0, sgv1):
- """Re-route all the inputs of sgv0 to sgv1 (see reroute_inputs)."""
+ """Re-route all the inputs of two subgraphs.
+
+ Args:
+ sgv0: the first subgraph to have its inputs 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 inputs swapped. This argument is
+ converted to a subgraph using the same rules than the function
+ subgraph.make_view.
+ Returns:
+ A tuple `(sgv0, sgv1)` of subgraph views with their inputs swapped.
+ Note that the function argument sgv0 and sgv1 are also modified in place.
+ Raises:
+ StandardError: if sgv0 or sgv1 cannot be converted to a SubGraphView using
+ the same rules than the function subgraph.make_view.
+ """
return _reroute_sgv_inputs(sgv0, sgv1, _RerouteMode.a2b)
def swap_outputs(sgv0, sgv1):
- """Swap all the outputs of sgv0 and sgv1 (see _reroute_outputs)."""
+ """Swap all the outputs of sgv0 and sgv1 (see reroute_outputs)."""
return _reroute_sgv_outputs(sgv0, sgv1, _RerouteMode.swap)
def reroute_outputs(sgv0, sgv1):
- """Re-route all the outputs of sgv0 to sgv1 (see _reroute_outputs)."""
+ """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
+ converted to a subgraph using the same rules than the function
+ subgraph.make_view.
+ Returns:
+ A tuple `(sgv0, sgv1)` of subgraph views with their outputs swapped.
+ Note that the function argument sgv0 and sgv1 are also modified in place.
+ Raises:
+ StandardError: if sgv0 or sgv1 cannot be converted to a SubGraphView using
+ the same rules than the function subgraph.make_view.
+ """
return _reroute_sgv_outputs(sgv0, sgv1, _RerouteMode.a2b)
def swap_ios(sgv0, sgv1):
- """Swap the inputs and outputs of sgv1 to sgv0 (see _reroute)."""
+ """Swap the inputs and outputs of sgv1 to sgv0 (see _reroute_sgv)."""
return _reroute_sgv(sgv0, sgv1, _RerouteMode.swap)
def reroute_ios(sgv0, sgv1):
- """Re-route the inputs and outputs of sgv0 to sgv1 (see _reroute)."""
+ """Re-route the inputs and outputs of sgv0 to sgv1 (see _reroute_sgv)."""
return _reroute_sgv(sgv0, sgv1, _RerouteMode.a2b)