class_docstr: A TraceGraph implementation of ELBO-based SVI. The gradient estimator
  is constructed along the lines of reference [1] specialized to the case
  of the ELBO. It supports arbitrary dependency structure for the model
  and guide as well as baselines for non-reparameterizable random variables.
  Fine-grained conditional dependency information as recorded in the
  :class:`~pyro.poutine.trace.Trace` is used to reduce the variance of the gradient estimator.
  In particular provenance tracking [3] is used to find the ``cost`` terms
  that depend on each non-reparameterizable sample site.
  
  References
  
  [1] `Gradient Estimation Using Stochastic Computation Graphs`,
      John Schulman, Nicolas Heess, Theophane Weber, Pieter Abbeel
  
  [2] `Neural Variational Inference and Learning in Belief Networks`
      Andriy Mnih, Karol Gregor
  
  [3] `Nonstandard Interpretations of Probabilistic Programs for Efficient Inference`,
      David Wingate, Noah Goodman, Andreas Stuhlmüller, Jeffrey Siskind
docstr: Returns a single trace from the guide, and the model that is run
  against it.
docstr_tok: ["Returns","a","single","trace","from","the","guide",",","and","the","model","that","is","run","against","it","."]
code: def _get_trace(self, model, guide, args, kwargs):
      """
      Returns a single trace from the guide, and the model that is run
      against it.
      """
      with TrackNonReparam():
          model_trace, guide_trace = get_importance_trace(
              "dense",
              self.max_plate_nesting,
              model,
              guide,
              args,
              kwargs,
          )
      if is_validation_enabled():
          check_if_enumerated(guide_trace)
      return model_trace, guide_trace
  
imports: import weakref
  from collections import defaultdict
  from operator import itemgetter
  import torch
  import pyro
  import pyro.ops.jit
  from pyro.distributions.util import detach, is_identically_zero
  from pyro.infer import ELBO
  from pyro.infer.enum import get_importance_trace
  from pyro.infer.util import MultiFrameTensor, get_plate_stacks, is_validation_enabled, torch_backward, torch_item
  from pyro.ops.provenance import detach_provenance, get_provenance, track_provenance
  from pyro.poutine.messenger import Messenger
  from pyro.poutine.subsample_messenger import _Subsample
  from pyro.util import check_if_enumerated, warn_if_nan
label_desc: Use image node_id 1 for calling the TraceGraph_ELBO obj's underlying member method code with example usage: obj._get_trace(model, guide, args, kwargs) and returns: model_trace,  guide_trace