code: def testMasking(self):
      seed_idx, seed_obs, seed_test, seed_sample = samplers.split_seed(
          test_util.test_seed(), 4
      )
      index_points = uniform.Uniform(-1.0, 1.0).sample(
          (4, 3, 2, 2), seed=seed_idx
      )
      observations = uniform.Uniform(-1.0, 1.0).sample(
          (4, 3, 2), seed=seed_obs
      )
      test_points = uniform.Uniform(-1.0, 1.0).sample(
          (4, 5, 2, 2), seed=seed_test
      )
  
      observations_is_missing = np.array(
          [
              [[True, True], [False, True], [True, False]],
              [[False, True], [False, True], [False, True]],
              [[False, False], [True, True], [True, False]],
              [[True, False], [False, True], [False, False]],
          ]
      )
      observations = tf.where(
          ~observations_is_missing, observations, np.nan
      )
  
      amplitude = tf.convert_to_tensor([0.5, 1.0, 1.75, 3.5])
      length_scale = tf.convert_to_tensor([0.3, 0.6, 0.9, 1.2])
      kernel = multitask_kernel.Independent(
          2,
          exponentiated_quadratic.ExponentiatedQuadratic(
              amplitude, length_scale, feature_ndims=2
          ),
          validate_args=True,
      )
  
      def mean_fn(x):
          return tf.math.reduce_sum(x, axis=[-1, -2])[
              ..., tf.newaxis
          ] * tf.convert_to_tensor([-0.5, 2.0])
  
      mtgp = mtgprm_lib.MultiTaskGaussianProcessRegressionModel(
          kernel,
          observation_index_points=index_points,
          observations=observations,
          observations_is_missing=observations_is_missing,
          index_points=test_points,
          predictive_noise_variance=0.05,
          mean_fn=mean_fn,
          validate_args=True,
      )
  
      # Compare to a GPRM where the task dimension has been moved to be the
      # rightmost batch dimension.
      gp = gprm.GaussianProcessRegressionModel.precompute_regression_model(
          kernel.base_kernel[..., tf.newaxis],
          observation_index_points=index_points[:, tf.newaxis],
          observations=tf.linalg.matrix_transpose(observations),
          observations_is_missing=tf.linalg.matrix_transpose(
              observations_is_missing
          ),
          index_points=test_points[:, tf.newaxis],
          predictive_noise_variance=0.05,
          mean_fn=lambda x: tf.linalg.matrix_transpose(
              mean_fn(x[:, 0])
          ),
          validate_args=True,
      )
  
      x = mtgp.sample(2, seed=seed_sample)
      self.assertAllNotNan(mtgp.log_prob(x))
      self.assertAllClose(
          tf.math.reduce_sum(
              gp.log_prob(tf.linalg.matrix_transpose(x)), axis=-1
          ),
          mtgp.log_prob(x),
      )
  
      self.assertAllNotNan(mtgp.mean())
      self.assertAllClose(
          tf.linalg.matrix_transpose(gp.mean()), mtgp.mean()
      )
  
imports: from unittest import mock
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import gaussian_process_regression_model
  from tensorflow_probability.python.distributions import uniform
  from tensorflow_probability.python.experimental.distributions import multitask_gaussian_process_regression_model
  from tensorflow_probability.python.experimental.psd_kernels import multitask_kernel
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
  from tensorflow_probability.python.math.psd_kernels.internal import test_util
label_desc: Use image node_id 8 for calling the MultiTaskGaussianProcessRegressionModelTest obj's underlying member method code with example usage: obj.testMasking() and returns: unknown