Generator that yields every TF_Operation in `graph`. Args: graph: Graph Yields: wrapped TF_Operation
(graph)
| 190 | |
| 191 | |
| 192 | def tf_operations(graph): |
| 193 | """Generator that yields every TF_Operation in `graph`. |
| 194 | |
| 195 | Args: |
| 196 | graph: Graph |
| 197 | |
| 198 | Yields: |
| 199 | wrapped TF_Operation |
| 200 | """ |
| 201 | # pylint: disable=protected-access |
| 202 | pos = 0 |
| 203 | c_op, pos = c_api.TF_GraphNextOperation(graph._c_graph, pos) |
| 204 | while c_op is not None: |
| 205 | yield c_op |
| 206 | c_op, pos = c_api.TF_GraphNextOperation(graph._c_graph, pos) |
| 207 | # pylint: enable=protected-access |
| 208 | |
| 209 | |
| 210 | def new_tf_operations(graph): |