class_docstr: Runs one step of the Metropolis-Hastings algorithm.
  
  The [Metropolis-Hastings algorithm](
  https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm) is a
  Markov chain Monte Carlo (MCMC) technique which uses a proposal distribution
  to eventually sample from a target distribution.
  
  Note: `inner_kernel.one_step` must return `kernel_results` as a
  `collections.namedtuple` which must:
  
  - have a `target_log_prob` field,
  - optionally have a `log_acceptance_correction` field, and,
  - have only fields which are `Tensor`-valued.
  
  The Metropolis-Hastings log acceptance-probability is computed as:
  
  ```python
  log_accept_ratio = (current_kernel_results.target_log_prob
                      - previous_kernel_results.target_log_prob
                      + current_kernel_results.log_acceptance_correction)
  ```
  
  If `current_kernel_results.log_acceptance_correction` does not exist, it is
  presumed `0.` (i.e., that the proposal distribution is symmetric).
  
  The most common use-case for `log_acceptance_correction` is in the
  Metropolis-Hastings algorithm, i.e.,
  
  ```none
  accept_prob(x' | x) = p(x') / p(x) (g(x|x') / g(x'|x))
  
  where,
    p  represents the target distribution,
    g  represents the proposal (conditional) distribution,
    x' is the proposed state, and,
    x  is current state
  ```
  
  The log of the parenthetical term is the `log_acceptance_correction`.
  
  The `log_acceptance_correction` may not necessarily correspond to the ratio of
  proposal distributions, e.g, `log_acceptance_correction` has a different
  interpretation in Hamiltonian Monte Carlo.
  
  #### Examples
  
  ```python
  import tensorflow_probability as tfp
  hmc = tfp.mcmc.MetropolisHastings(
      tfp.mcmc.UncalibratedHamiltonianMonteCarlo(
          target_log_prob_fn=lambda x: -x - x**2,
          step_size=0.1,
          num_leapfrog_steps=3))
  # ==> functionally equivalent to:
  # hmc = tfp.mcmc.HamiltonianMonteCarlo(
  #     target_log_prob_fn=lambda x: -x - x**2,
  #     step_size=0.1,
  #     num_leapfrog_steps=3)
  ```
docstr: Instantiates this object.
  
  Args:
    inner_kernel: `TransitionKernel`-like object which has
      `collections.namedtuple` `kernel_results` and which contains a
      `target_log_prob` member and optionally a `log_acceptance_correction`
      member.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., "mh_kernel").
  
  Returns:
    metropolis_hastings_kernel: Instance of `TransitionKernel` which wraps the
      input transition kernel with the Metropolis-Hastings algorithm.
docstr_tok: ["Instantiates","this","object",".","Args",":","inner_kernel",":","`","TransitionKernel","`","-like","object","which","has","`","collections.namedtuple","`","`","kernel_results","`","and","which","contains","a","`","target_log_prob","`","member","and","optionally","a","`","log_acceptance_correction","`","member",".","name",":","Python","`","str","`","name","prefixed","to","Ops","created","by","this","function",".","Default","value",":","`","None","`","(","i.e.",",","``","mh_kernel","''",")",".","Returns",":","metropolis_hastings_kernel",":","Instance","of","`","TransitionKernel","`","which","wraps","the","input","transition","kernel","with","the","Metropolis-Hastings","algorithm","."]
code: def __init__(self, inner_kernel, name=None):
      """Instantiates this object.
  
      Args:
        inner_kernel: `TransitionKernel`-like object which has
          `collections.namedtuple` `kernel_results` and which contains a
          `target_log_prob` member and optionally a `log_acceptance_correction`
          member.
        name: Python `str` name prefixed to Ops created by this function.
          Default value: `None` (i.e., "mh_kernel").
  
      Returns:
        metropolis_hastings_kernel: Instance of `TransitionKernel` which wraps the
          input transition kernel with the Metropolis-Hastings algorithm.
      """
      if inner_kernel.is_calibrated:
          warnings.warn(
              "Supplied `TransitionKernel` is already calibrated. "
              "Composing `MetropolisHastings` `TransitionKernel` "
              "may not be required."
          )
      self._parameters = dict(inner_kernel=inner_kernel, name=name)
  
imports: import collections
  import warnings
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 1 to create a new MetropolisHastings object from inherited base classes: kernel_base with example: obj = MetropolisHastings(inner_kernel, name)