Detach both the inputs and the outputs of a subgraph view. 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. Note that sgv is modified in place. control_inputs: A boolean indicating wh
(sgv, control_inputs=False, control_outputs=None, control_ios=None)
| 139 | |
| 140 | |
| 141 | def detach(sgv, control_inputs=False, control_outputs=None, control_ios=None): |
| 142 | """Detach both the inputs and the outputs of a subgraph view. |
| 143 | |
| 144 | Args: |
| 145 | sgv: the subgraph view to be detached. This argument is converted to a |
| 146 | subgraph using the same rules as the function subgraph.make_view. |
| 147 | Note that sgv is modified in place. |
| 148 | control_inputs: A boolean indicating whether control inputs are enabled. |
| 149 | control_outputs: An instance of util.ControlOutputs or None. If not None, |
| 150 | control outputs are enabled. |
| 151 | control_ios: An instance of util.ControlOutputs or None. If not None, both |
| 152 | control inputs and control outputs are enabled. This is equivalent to set |
| 153 | control_inputs to True and control_outputs to the util.ControlOutputs |
| 154 | instance. |
| 155 | Returns: |
| 156 | A tuple `(sgv, detached_inputs, detached_outputs)` where: |
| 157 | `sgv` is a new subgraph view of the detached subgraph; |
| 158 | `detach_inputs` is a list of the created input placeholders; |
| 159 | `detach_outputs` is a list of the created output placeholders. |
| 160 | Raises: |
| 161 | StandardError: if sgv cannot be converted to a SubGraphView using |
| 162 | the same rules than the function subgraph.make_view. |
| 163 | """ |
| 164 | control_inputs, control_outputs = select.check_cios(control_inputs, |
| 165 | control_outputs, |
| 166 | control_ios) |
| 167 | _, detached_inputs = detach_inputs(sgv, control_inputs) |
| 168 | _, detached_outputs = detach_outputs(sgv, control_outputs) |
| 169 | return sgv, detached_inputs, detached_outputs |
| 170 | |
| 171 | |
| 172 | def connect(sgv0, sgv1, disconnect_first=False): |
nothing calls this directly
no test coverage detected