code: def test_log_prob_ratio(self):
      p = masked.Masked(
          mvn_diag.MultivariateNormalDiag(
              tf.zeros([4, 3000]), tf.ones([3000])
          ),
          tf.sequence_mask(2, 4),
      )
      q = masked.Masked(
          mvn_diag.MultivariateNormalDiag(
              tf.zeros([4, 3000]), tf.ones([3000])
          ),
          [True, True, False, False],
      )
      stream = test_util.test_seed_stream()
      x = p.sample(seed=stream())
      y = x + 1e-5 * q.sample(seed=stream())
      x, y = self.evaluate(
          (x, y)
      )  # Avoids different samples across evals.
      normal64 = normal.Normal(0, 1)
      self.assertAllClose(
          tf.reduce_sum(
              normal64.log_prob(x) - normal64.log_prob(y), axis=-1
          )
          * tf.sequence_mask(2, 4, dtype=tf.float32),
          tf.cast(
              log_prob_ratio.log_prob_ratio(p, x, q, y), tf.float64
          ),
      )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import log_prob_ratio
  from tensorflow_probability.python.distributions import lognormal
  from tensorflow_probability.python.distributions import masked
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import relaxed_onehot_categorical
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 9 for calling the MaskedTest obj's underlying member method code with example usage: obj.test_log_prob_ratio() without return types