code: def testLogProbWithIsMissing(self):
      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)
  
      gp = gaussian_process.GaussianProcess(
          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 = gp.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 = gp.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
      # GaussianProcess without the missing index points.
      for i in range(5):
          gp_i = gaussian_process.GaussianProcess(
              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 = gp_i.log_prob(
              tf.gather(x[i], (~is_missing[i]).nonzero()[0])
          )
          # NOTE: This reshape is necessary because lp_i has shape [1] when
          # gp_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)),
          gp.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 gaussian_process
  from tensorflow_probability.python.distributions import gaussian_process_regression_model
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  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 10 for calling the _GaussianProcessTest obj's underlying member method code with example usage: obj.testLogProbWithIsMissing() without return types