Create a dictionary of control-output dependencies. Args: graph: a `tf.Graph`. Returns: A dictionary where a key is a `tf.Operation` instance and the corresponding value is a list of all the ops which have the key as one of their control-input dependencies.
(self, graph)
| 339 | """The control outputs topology.""" |
| 340 | |
| 341 | def __init__(self, graph): |
| 342 | """Create a dictionary of control-output dependencies. |
| 343 | |
| 344 | Args: |
| 345 | graph: a `tf.Graph`. |
| 346 | Returns: |
| 347 | A dictionary where a key is a `tf.Operation` instance and the |
| 348 | corresponding value is a list of all the ops which have the key |
| 349 | as one of their control-input dependencies. |
| 350 | Raises: |
| 351 | TypeError: graph is not a `tf.Graph`. |
| 352 | """ |
| 353 | if not isinstance(graph, tf_ops.Graph): |
| 354 | raise TypeError("Expected a tf.Graph, got: {}".format(type(graph))) |
| 355 | self._control_outputs = {} |
| 356 | self._graph = graph |
| 357 | self._version = None |
| 358 | self._build() |
| 359 | |
| 360 | def update(self): |
| 361 | """Update the control outputs if the graph has changed.""" |