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

Function bypass

tensorflow/contrib/graph_editor/edit.py:201–221  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

199
200
201def 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

Callers

nothing calls this directly

Calls 1

detach_inputsFunction · 0.85

Tested by

no test coverage detected