(handle)
| 228 | |
| 229 | @contextlib.contextmanager |
| 230 | def _handle_graph(handle): |
| 231 | # Note: might have an eager tensor but not be executing eagerly when building |
| 232 | # functions. |
| 233 | if (context.executing_eagerly() or isinstance(handle, ops.EagerTensor) |
| 234 | or ops.has_default_graph()): |
| 235 | yield |
| 236 | else: |
| 237 | with handle.graph.as_default(): |
| 238 | yield |
| 239 | |
| 240 | |
| 241 | class EagerResourceDeleter(object): |
no test coverage detected