class_docstr: :class:`ELBO` is the top-level interface for stochastic variational
  inference via optimization of the evidence lower bound.
  
  Most users will not interact with this base class :class:`ELBO` directly;
  instead they will create instances of derived classes:
  :class:`~pyro.infer.trace_elbo.Trace_ELBO`,
  :class:`~pyro.infer.tracegraph_elbo.TraceGraph_ELBO`, or
  :class:`~pyro.infer.traceenum_elbo.TraceEnum_ELBO`.
  
  .. note:: Derived classes now provide a more idiomatic PyTorch interface via
      :meth:`__call__` for (model, guide) pairs that are :class:`~torch.nn.Module` s,
      which is useful for integrating Pyro's variational inference tooling with
      standard PyTorch interfaces like :class:`~torch.optim.Optimizer` s
      and the large ecosystem of libraries like PyTorch Lightning
      and the PyTorch JIT that work with these interfaces::
  
          model = Model()
          guide = pyro.infer.autoguide.AutoNormal(model)
  
          elbo_ = pyro.infer.Trace_ELBO(num_particles=10)
  
          # Fix the model/guide pair
          elbo = elbo_(model, guide)
  
          # perform any data-dependent initialization
          elbo(data)
  
          optim = torch.optim.Adam(elbo.parameters(), lr=0.001)
  
          for _ in range(100):
              optim.zero_grad()
              loss = elbo(data)
              loss.backward()
              optim.step()
  
      Note that Pyro's global parameter store may cause this new interface to
      behave unexpectedly relative to standard PyTorch when working with
      :class:`~pyro.nn.PyroModule` s.
  
      Users are therefore strongly encouraged to use this interface in
      conjunction with ``pyro.settings.set(module_local_params=True)`` which
      will override the default implicit sharing of parameters across
      :class:`~pyro.nn.PyroModule` instances.
  
  :param num_particles: The number of particles/samples used to form the ELBO
      (gradient) estimators.
  :param int max_plate_nesting: Optional bound on max number of nested
      :func:`pyro.plate` contexts. This is only required when enumerating
      over sample sites in parallel, e.g. if a site sets
      ``infer={"enumerate": "parallel"}``. If omitted, ELBO may guess a valid
      value by running the (model,guide) pair once, however this guess may
      be incorrect if model or guide structure is dynamic.
  :param bool vectorize_particles: Whether to vectorize the ELBO computation
      over `num_particles`. Defaults to False. This requires static structure
      in model and guide.
  :param bool strict_enumeration_warning: Whether to warn about possible
      misuse of enumeration, i.e. that
      :class:`pyro.infer.traceenum_elbo.TraceEnum_ELBO` is used iff there
      are enumerated sample sites.
  :param bool ignore_jit_warnings: Flag to ignore warnings from the JIT
      tracer. When this is True, all :class:`torch.jit.TracerWarning` will
      be ignored. Defaults to False.
  :param bool jit_options: Optional dict of options to pass to
      :func:`torch.jit.trace` , e.g. ``{"check_trace": True}``.
  :param bool retain_graph: Whether to retain autograd graph during an SVI
      step. Defaults to None (False).
  :param float tail_adaptive_beta: Exponent beta with ``-1.0 <= beta < 0.0`` for
      use with `TraceTailAdaptive_ELBO`.
  
  References
  
  [1] `Automated Variational Inference in Probabilistic Programming`
  David Wingate, Theo Weber
  
  [2] `Black Box Variational Inference`,
  Rajesh Ranganath, Sean Gerrish, David M. Blei
docstr: Given a model and guide, returns a :class:`~torch.nn.Module` which
  computes the ELBO loss when called with arguments to the model and guide.
docstr_tok: ["Given","a","model","and","guide",",","returns","a",":","class",":","`","~torch.nn.Module","`","which","computes","the","ELBO","loss","when","called","with","arguments","to","the","model","and","guide","."]
code: def __call__(
      self, model: torch.nn.Module, guide: torch.nn.Module
  ) -> ELBOModule:
      """
      Given a model and guide, returns a :class:`~torch.nn.Module` which
      computes the ELBO loss when called with arguments to the model and guide.
      """
      return ELBOModule(model, guide, self)
  
imports: import logging
  import warnings
  from abc import ABCMeta, abstractmethod
  import torch
  import pyro
  import pyro.poutine
  from pyro.infer.util import is_validation_enabled
  from pyro.poutine.util import prune_subsample_sites
  from pyro.util import check_site_shape
label_desc: Use image node_id 2 for calling the ELBO obj's underlying member method code with example usage: obj.__call__(model, guide) and returns: ELBOModule