class_docstr: Simple Hamiltonian Monte Carlo kernel, where ``step_size`` and ``num_steps``
  need to be explicitly specified by the user.
  
  **References**
  
  [1] `MCMC Using Hamiltonian Dynamics`,
  Radford M. Neal
  
  :param model: Python callable containing Pyro primitives.
  :param potential_fn: Python callable calculating potential energy with input
      is a dict of real support parameters.
  :param float step_size: Determines the size of a single step taken by the
      verlet integrator while computing the trajectory using Hamiltonian
      dynamics. If not specified, it will be set to 1.
  :param float trajectory_length: Length of a MCMC trajectory. If not
      specified, it will be set to ``step_size x num_steps``. In case
      ``num_steps`` is not specified, it will be set to :math:`2\pi`.
  :param int num_steps: The number of discrete steps over which to simulate
      Hamiltonian dynamics. The state at the end of the trajectory is
      returned as the proposal. This value is always equal to
      ``int(trajectory_length / step_size)``.
  :param bool adapt_step_size: A flag to decide if we want to adapt step_size
      during warm-up phase using Dual Averaging scheme.
  :param bool adapt_mass_matrix: A flag to decide if we want to adapt mass
      matrix during warm-up phase using Welford scheme.
  :param bool full_mass: A flag to decide if mass matrix is dense or diagonal.
  :param dict transforms: Optional dictionary that specifies a transform
      for a sample site with constrained support to unconstrained space. The
      transform should be invertible, and implement `log_abs_det_jacobian`.
      If not specified and the model has sites with constrained support,
      automatic transformations will be applied, as specified in
      :mod:`torch.distributions.constraint_registry`.
  :param int max_plate_nesting: Optional bound on max number of nested
      :func:`pyro.plate` contexts. This is required if model contains
      discrete sample sites that can be enumerated over in parallel.
  :param bool jit_compile: Optional parameter denoting whether to use
      the PyTorch JIT to trace the log density computation, and use this
      optimized executable trace in the integrator.
  :param dict jit_options: A dictionary contains optional arguments for
      :func:`torch.jit.trace` function.
  :param bool ignore_jit_warnings: Flag to ignore warnings from the JIT
      tracer when ``jit_compile=True``. Default is False.
  :param float target_accept_prob: Increasing this value will lead to a smaller
      step size, hence the sampling will be slower and more robust. Default to 0.8.
  :param callable init_strategy: A per-site initialization function.
      See :ref:`autoguide-initialization` section for available functions.
  :param min_stepsize (float): Lower bound on stepsize in adaptation strategy.
  :param max_stepsize (float): Upper bound on stepsize in adaptation strategy.
  
  .. note:: Internally, the mass matrix will be ordered according to the order
      of the names of latent variables, not the order of their appearance in
      the model.
  
  Example:
  
      >>> true_coefs = torch.tensor([1., 2., 3.])
      >>> data = torch.randn(2000, 3)
      >>> dim = 3
      >>> labels = dist.Bernoulli(logits=(true_coefs * data).sum(-1)).sample()
      >>>
      >>> def model(data):
      ...     coefs_mean = torch.zeros(dim)
      ...     coefs = pyro.sample('beta', dist.Normal(coefs_mean, torch.ones(3)))
      ...     y = pyro.sample('y', dist.Bernoulli(logits=(coefs * data).sum(-1)), obs=labels)
      ...     return y
      >>>
      >>> hmc_kernel = HMC(model, step_size=0.0855, num_steps=4)
      >>> mcmc = MCMC(hmc_kernel, num_samples=500, warmup_steps=100)
      >>> mcmc.run(data)
      >>> mcmc.get_samples()['beta'].mean(0)  # doctest: +SKIP
      tensor([ 0.9819,  1.9258,  2.9737])
code: def mass_matrix_adapter(self, value):
      self._adapter.mass_matrix_adapter = value
  
imports: import math
  from collections import OrderedDict
  import torch
  import pyro
  import pyro.distributions
  from pyro.distributions.testing.fakes import NonreparameterizedNormal
  from pyro.distributions.util import scalar_like
  from pyro.infer.autoguide import init_to_uniform
  from pyro.infer.mcmc.adaptation import WarmupAdapter
  from pyro.infer.mcmc.mcmc_kernel import MCMCKernel
  from pyro.infer.mcmc.util import initialize_model
  from pyro.ops.integrator import _EXCEPTION_HANDLERS, potential_grad, velocity_verlet
  from pyro.util import optional, torch_isnan
label_desc: Use image node_id 7 for calling the HMC obj's underlying member method code with example usage: obj.mass_matrix_adapter(value) without return types