class_docstr: `dict` that enables unbound weakref callback.
class_docstr_tok: ["`","dict","`","that","enables","unbound","weakref","callback","."]
code: def __init__(self, *args, **kwargs):
      super(EphemeralDict, self).__init__(*args, **kwargs)
  
      weakself = weakref.ref(self)
  
      def maybe_del(key):
          self = weakself()
          if self is not None:
              del self[key]
  
      self.maybe_del = maybe_del
  
imports: import collections
  import weakref
  import numpy
  import tensorflow.compat.v2
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 to create a new EphemeralDict object from inherited base classes: dict with example: obj = EphemeralDict()