code: def _markov_chain_log_prob_ratio(p, x, q, y, name=None):
      """Implements `log_prob_ratio` for tfd.MarkovChain."""
      with tf.name_scope(name or "markov_chain_log_prob_ratio"):
          # TODO(davmre): In the case where `p` and `q` have components of the same
          # families (in addition to just both being MarkovChains), we might prefer to
          # recursively call `log_prob_ratio` instead of just subtracting log probs.
          p_prior_lp, p_transition_lps = p._log_prob_parts(x)
          q_prior_lp, q_transition_lps = q._log_prob_parts(y)
          prior_lp_ratio = p_prior_lp - q_prior_lp
          transition_lp_ratios = p_transition_lps - q_transition_lps
          if (
              p._experimental_use_kahan_sum
              or q._experimental_use_kahan_sum
          ):
              transition_lp_ratio = generic.reduce_kahan_sum(
                  transition_lp_ratios, axis=0
              ).value
          else:
              transition_lp_ratio = tf.reduce_sum(
                  transition_lp_ratios, axis=0
              )
          return prior_lp_ratio + transition_lp_ratio
  
imports: import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 3 for calling a global function with example usage: _markov_chain_log_prob_ratio(p, x, q, y, name) and returns: unknown