code: def testValidateArgs(self):
      index_points = np.linspace(-4.0, 4.0, 10, dtype=np.float32)
      index_points = np.reshape(index_points, [5, 2])
      index_points = np.linspace(-4.0, 4.0, 16, dtype=np.float32)
      observation_index_points = np.reshape(index_points, [8, 2])
  
      observation_noise_variance = 1e-4
      kernel = exponentiated_quadratic.ExponentiatedQuadratic()
      multi_task_kernel = multitask_kernel.Independent(
          num_tasks=3, base_kernel=kernel
      )
      with self.assertRaisesRegexp(
          ValueError, "match the number of tasks"
      ):
          observations = np.linspace(-1.0, 1.0, 24).astype(np.float32)
          mtgprm_lib.MultiTaskGaussianProcessRegressionModel(
              multi_task_kernel,
              observation_index_points=observation_index_points,
              observations=observations,
              index_points=index_points,
              observation_noise_variance=observation_noise_variance,
              validate_args=True,
          )
  
      with self.assertRaisesRegexp(
          ValueError, "match the number of tasks"
      ):
          observations = (
              np.linspace(-1.0, 1.0, 32)
              .reshape(8, 4)
              .astype(np.float32)
          )
          mtgprm_lib.MultiTaskGaussianProcessRegressionModel(
              multi_task_kernel,
              observation_index_points=observation_index_points,
              observations=observations,
              index_points=index_points,
              observation_noise_variance=observation_noise_variance,
              validate_args=True,
          )
  
      with self.assertRaisesRegexp(
          ValueError, "match the second to last dimension"
      ):
          observations = (
              np.linspace(-1.0, 1.0, 18)
              .reshape(6, 3)
              .astype(np.float32)
          )
          mtgprm_lib.MultiTaskGaussianProcessRegressionModel(
              multi_task_kernel,
              observation_index_points=observation_index_points,
              observations=observations,
              index_points=index_points,
              observation_noise_variance=observation_noise_variance,
              validate_args=True,
          )
  
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 3 for calling the MultiTaskGaussianProcessRegressionModelTest obj's underlying member method code with example usage: obj.testValidateArgs() without return types