class_docstr: Like :class:`TraceEnum_ELBO` but uses :func:`pyro.ops.jit.compile` to
  compile :meth:`loss_and_grads`.
  
  This works only for a limited set of models:
  
  -   Models must have static structure.
  -   Models must not depend on any global data (except the param store).
  -   All model inputs that are tensors must be passed in via ``*args``.
  -   All model inputs that are *not* tensors must be passed in via
      ``**kwargs``, and compilation will be triggered once per unique
      ``**kwargs``.
class_docstr_tok: ["Like",":","class",":","`","TraceEnum_ELBO","`","but","uses",":","func",":","`","pyro.ops.jit.compile","`","to","compile",":","meth",":","`","loss_and_grads","`",".","This","works","only","for","a","limited","set","of","models",":","-","Models","must","have","static","structure",".","-","Models","must","not","depend","on","any","global","data","(","except","the","param","store",")",".","-","All","model","inputs","that","are","tensors","must","be","passed","in","via","``","*","args","``",".","-","All","model","inputs","that","are","*","not","*","tensors","must","be","passed","in","via","``","*","*","kwargs","``",",","and","compilation","will","be","triggered","once","per","unique","``","*","*","kwargs","``","."]
code: def differentiable_loss(self, model, guide, *args, **kwargs):
      kwargs["_model_id"] = id(model)
      kwargs["_guide_id"] = id(guide)
      if getattr(self, "_differentiable_loss", None) is None:
          # build a closure for differentiable_loss
          weakself = weakref.ref(self)
  
          @pyro.ops.jit.trace(
              ignore_warnings=self.ignore_jit_warnings,
              jit_options=self.jit_options,
          )
          def differentiable_loss(*args, **kwargs):
              kwargs.pop("_model_id")
              kwargs.pop("_guide_id")
              self = weakself()
              elbo = 0.0
              for model_trace, guide_trace in self._get_traces(
                  model, guide, args, kwargs
              ):
                  elbo = elbo + _compute_dice_elbo(
                      model_trace, guide_trace
                  )
              return elbo * (-1.0 / self.num_particles)
  
          self._differentiable_loss = differentiable_loss
  
      return self._differentiable_loss(*args, **kwargs)
  
imports: import queue
  import warnings
  import weakref
  from collections import OrderedDict
  import torch
  from opt_einsum import shared_intermediates
  import pyro
  import pyro.distributions
  import pyro.ops.jit
  import pyro.poutine
  from pyro.distributions.util import is_identically_zero
  from pyro.infer.elbo import ELBO
  from pyro.infer.enum import get_importance_trace, iter_discrete_escape, iter_discrete_extend
  from pyro.infer.util import Dice, is_validation_enabled
  from pyro.ops import packed
  from pyro.ops.contract import contract_tensor_tree, contract_to_tensor
  from pyro.ops.rings import SampleRing
  from pyro.poutine.enum_messenger import EnumMessenger
  from pyro.util import check_traceenum_requirements, ignore_jit_warnings, warn_if_nan
label_desc: Use image node_id 1 for calling the JitTraceEnum_ELBO obj's underlying member method code with example usage: obj.differentiable_loss(model, guide) and returns: self, unknown