class_docstr: Sometimes-active cache for ``PyroModule.__call__()`` contexts.
class_docstr_tok: ["Sometimes-active","cache","for","``","PyroModule.__call__","(",")","``","contexts","."]
code: def __exit__(self, type, value, traceback):
      self.active -= 1
      if not self.active:
          self.cache.clear()
          if _is_module_local_param_enabled():
              self._param_ctx.__exit__(type, value, traceback)
              del self._param_ctx
  
imports: import functools
  import inspect
  import weakref
  from collections import OrderedDict, namedtuple
  import torch
  from torch.distributions import constraints, transform_to
  import pyro
  from pyro.ops.provenance import detach_provenance
  from pyro.poutine.runtime import _PYRO_PARAM_STORE
label_desc: Use image node_id 3 for calling the _Context obj's underlying member method code with example usage: obj.__exit__(type, value, traceback) without return types