class_docstr: A basic implementation of Stein Variational Gradient Descent as described in reference [1].
  
  :param model: The model (callable containing Pyro primitives). Model must be fully vectorized
      and may only contain continuous latent variables.
  :param kernel: a SVGD compatible kernel like :class:`RBFSteinKernel`.
  :param optim: A wrapper for a PyTorch optimizer.
  :type optim: pyro.optim.PyroOptim
  :param int num_particles: The number of particles used in SVGD.
  :param int max_plate_nesting: The max number of nested :func:`pyro.plate` contexts in the model.
  :param str mode: Whether to use a Kernelized Stein Discrepancy that makes use of `multivariate`
      test functions (as in [1]) or `univariate` test functions (as in [2]). Defaults to `univariate`.
  
  Example usage:
  
  .. code-block:: python
  
      from pyro.infer import SVGD, RBFSteinKernel
      from pyro.optim import Adam
  
      kernel = RBFSteinKernel()
      adam = Adam({"lr": 0.1})
      svgd = SVGD(model, kernel, adam, num_particles=50, max_plate_nesting=0)
  
      for step in range(500):
          svgd.step(model_arg1, model_arg2)
  
      final_particles = svgd.get_named_particles()
  
  References
  
  [1] "Stein Variational Gradient Descent: A General Purpose Bayesian Inference Algorithm,"
      Qiang Liu, Dilin Wang
  [2] "Kernelized Complete Conditional Stein Discrepancy,"
      Raghav Singhal, Saad Lahlou, Rajesh Ranganath
docstr: Create a dictionary mapping name to vectorized value, of the form ``{name: tensor}``.
  The leading dimension of each tensor corresponds to particles, i.e. this creates a struct of arrays.
docstr_tok: ["Create","a","dictionary","mapping","name","to","vectorized","value",",","of","the","form","``","{","name",":","tensor","}","``",".","The","leading","dimension","of","each","tensor","corresponds","to","particles",",","i.e",".","this","creates","a","struct","of","arrays","."]
code: def get_named_particles(self):
      """
      Create a dictionary mapping name to vectorized value, of the form ``{name: tensor}``.
      The leading dimension of each tensor corresponds to particles, i.e. this creates a struct of arrays.
      """
      return {
          site["name"]: biject_to(site["fn"].support)(
              unconstrained_value
          )
          for site, unconstrained_value in self.guide._unpack_latent(
              pyro.param("svgd_particles")
          )
      }
  
imports: import math
  from abc import ABCMeta, abstractmethod
  import torch
  from torch.distributions import biject_to
  import pyro
  from pyro import poutine
  from pyro.distributions import Delta
  from pyro.distributions.util import copy_docs_from
  from pyro.infer.autoguide.guides import AutoContinuous
  from pyro.infer.autoguide.initialization import init_to_sample
  from pyro.infer.trace_elbo import Trace_ELBO
label_desc: Use image node_id 2 for calling the SVGD obj's underlying member method code with example usage: obj.get_named_particles() and returns: unknown