code: def testBindingIndexPoints(self):
      amplitude = np.float64(0.5)
      length_scale = np.float64(2.0)
      kernel = exponentiated_quadratic.ExponentiatedQuadratic(
          amplitude, length_scale
      )
      num_tasks = 3
      multi_task_kernel = multitask_kernel.Independent(
          num_tasks=num_tasks, base_kernel=kernel
      )
      mean_fn = lambda x: tf.stack([x[..., 0]] * num_tasks, axis=-1)
      observation_noise_variance = np.float64(1e-3)
      mtgp = multitask_gaussian_process.MultiTaskGaussianProcess(
          kernel=multi_task_kernel,
          mean_fn=mean_fn,
          observation_noise_variance=observation_noise_variance,
          validate_args=True,
      )
      gp = gaussian_process.GaussianProcess(
          kernel=kernel,
          mean_fn=lambda x: x[..., 0],
          observation_noise_variance=observation_noise_variance,
          validate_args=True,
      )
  
      index_points = np.random.uniform(-1.0, 1.0, [5, 10, 4])
      observations = np.random.uniform(-1.0, 1.0, [10, num_tasks])
  
      # Check that the internal batch_shape and event_shape methods work.
      self.assertAllEqual(
          [5], mtgp._batch_shape(index_points=index_points)
      )  # pylint: disable=protected-access
      self.assertAllEqual(
          [10, 3], mtgp._event_shape(index_points=index_points)
      )  # pylint: disable=protected-access
  
      multi_task_log_prob = mtgp.log_prob(
          observations, index_points=index_points
      )
      single_task_log_prob = sum(
          gp.log_prob(observations[..., i], index_points=index_points)
          for i in range(num_tasks)
      )
      self.assertAllClose(
          self.evaluate(single_task_log_prob),
          self.evaluate(multi_task_log_prob),
          rtol=4e-3,
      )
  
      multi_task_mean_ = self.evaluate(
          mtgp.mean(index_points=index_points)
      )
      single_task_mean_ = self.evaluate(
          gp.mean(index_points=index_points)
      )
      for i in range(3):
          self.assertAllClose(
              single_task_mean_, multi_task_mean_[..., i], rtol=1e-3
          )
  
      multi_task_var_ = self.evaluate(
          mtgp.variance(index_points=index_points)
      )
      single_task_var_ = self.evaluate(
          gp.variance(index_points=index_points)
      )
      for i in range(3):
          self.assertAllClose(
              single_task_var_, multi_task_var_[..., i], rtol=1e-3
          )
  
      # Check that late-binding samples work.
      self.evaluate(
          mtgp.sample(
              seed=test_util.test_seed(), index_points=index_points
          )
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import gaussian_process
  from tensorflow_probability.python.experimental.distributions import multitask_gaussian_process
  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 dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import tensor_util
  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 2 for calling the MultiTaskGaussianProcessTest obj's underlying member method code with example usage: obj.testBindingIndexPoints() without return types