code: def testLogProbWithIsMissing(self):
      df = tf.convert_to_tensor(3.0)
      index_points = tf.Variable(
          [[-1.0, 0.0], [-0.5, -0.5], [1.5, 0.0], [1.6, 1.5]],
          shape=None if self.is_static else tf.TensorShape(None),
      )
      self.evaluate(index_points.initializer)
      amplitude = tf.convert_to_tensor(1.1)
      length_scale = tf.convert_to_tensor(0.9)
  
      stp = student_t_process.StudentTProcess(
          df=df,
          kernel=psd_kernels.ExponentiatedQuadratic(
              amplitude, length_scale
          ),
          index_points=index_points,
          mean_fn=lambda x: tf.reduce_mean(x, axis=-1),
          observation_noise_variance=0.05,
          jitter=0.0,
      )
  
      x = stp.sample(5, seed=test_util.test_seed())
  
      is_missing = np.array(
          [
              [False, True, False, False],
              [False, False, False, False],
              [True, False, True, True],
              [True, False, False, True],
              [False, False, True, True],
          ]
      )
  
      lp = stp.log_prob(
          tf.where(is_missing, np.nan, x), is_missing=is_missing
      )
  
      # For each batch member, check that the log_prob is the same as for a
      # StudentTProcess without the missing index points.
      for i in range(5):
          stp_i = student_t_process.StudentTProcess(
              df=df,
              kernel=psd_kernels.ExponentiatedQuadratic(
                  amplitude, length_scale
              ),
              index_points=tf.gather(
                  index_points, (~is_missing[i]).nonzero()[0]
              ),
              mean_fn=lambda x: tf.reduce_mean(x, axis=-1),
              observation_noise_variance=0.05,
              jitter=0.0,
          )
          lp_i = stp_i.log_prob(
              tf.gather(x[i], (~is_missing[i]).nonzero()[0])
          )
          # NOTE: This reshape is necessary because lp_i has shape [1] when
          # stp_i.index_points contains a single index point.
          self.assertAllClose(tf.reshape(lp_i, []), lp[i])
  
      # The log_prob should be zero when all points are missing out.
      self.assertAllClose(
          tf.zeros((3, 2)),
          stp.log_prob(
              tf.ones((3, 1, 4)) * np.nan,
              is_missing=tf.constant(True, shape=(2, 4)),
          ),
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import multivariate_student_t
  from tensorflow_probability.python.distributions import student_t_process
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math import psd_kernels
  from tensorflow_probability.python.math.psd_kernels.internal import test_util
label_desc: Use image node_id 8 for calling the _StudentTProcessTest obj's underlying member method code with example usage: obj.testLogProbWithIsMissing() without return types