Deletes tensor caches for a given context.
| 306 | |
| 307 | |
| 308 | class _TensorCacheDeleter(object): |
| 309 | """Deletes tensor caches for a given context.""" |
| 310 | |
| 311 | def __init__(self, context_id): |
| 312 | self._context_id = context_id |
| 313 | |
| 314 | def __del__(self): |
| 315 | if _tensor_caches_map is None: |
| 316 | return |
| 317 | if self._context_id in _tensor_caches_map: |
| 318 | del _tensor_caches_map[self._context_id] |
| 319 | |
| 320 | |
| 321 | # Thread-local stack of execution callbacks. |