code: def test_log_prob(self):
      d = masked.Masked(
          normal.Normal(tf.zeros([20]), 1), tf.sequence_mask(15, 20)
      )
      x = np.linspace(-0.1, 0.1, 20).astype(np.float32)
      self.assertAllClose(
          tf.pad(normal.Normal(0, 1).log_prob(x[:15]), [[0, 5]]),
          d.log_prob(x),
      )
  
      d = masked.Masked(
          normal.Normal(tf.zeros([20]), 1), (tf.range(20) % 2) > 0
      )
      x = np.linspace(-0.1, 0.1, 20).astype(np.float32)
      self.assertAllClose(tf.zeros(10), d.log_prob(x)[::2])
      self.assertAllClose(
          normal.Normal(0, 1).log_prob(x)[1::2], d.log_prob(x)[1::2]
      )
  
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 6 for calling the MaskedTest obj's underlying member method code with example usage: obj.test_log_prob() without return types