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

Function detach_control_outputs

tensorflow/contrib/graph_editor/edit.py:51–67  ·  view source on GitHub ↗

Detach all the external control outputs of the subgraph sgv. Args: sgv: the subgraph view to be detached. This argument is converted to a subgraph using the same rules as the function subgraph.make_view. control_outputs: a util.ControlOutputs instance.

(sgv, control_outputs)

Source from the content-addressed store, hash-verified

49
50
51def detach_control_outputs(sgv, control_outputs):
52 """Detach all the external control outputs of the subgraph sgv.
53
54 Args:
55 sgv: the subgraph view to be detached. This argument is converted to a
56 subgraph using the same rules as the function subgraph.make_view.
57 control_outputs: a util.ControlOutputs instance.
58 """
59 if not isinstance(control_outputs, util.ControlOutputs):
60 raise TypeError("Expected a util.ControlOutputs, got: {}",
61 type(control_outputs))
62 control_outputs.update()
63 sgv = subgraph.make_view(sgv)
64 for op in sgv.ops:
65 for cop in control_outputs.get(op):
66 if cop not in sgv.ops:
67 reroute.remove_control_inputs(cop, op)
68
69
70def detach_inputs(sgv, control_inputs=False):

Callers 1

detach_outputsFunction · 0.85

Calls 3

typeFunction · 0.85
updateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected