code: def testPrecomputedCompositeTensor(self):
      num_tasks = 3
      amplitude = np.array([1.0, 2.0], np.float64).reshape([2, 1])
      length_scale = np.array([0.1, 0.2, 0.3], np.float64).reshape(
          [1, 3]
      )
      observation_noise_variance = np.array([1e-9], np.float64)
  
      observation_index_points = np.random.uniform(
          -1.0, 1.0, (1, 1, 7, 2)
      ).astype(np.float64)
      observations = np.random.uniform(
          -1.0, 1.0, (1, 1, 7, num_tasks)
      ).astype(np.float64)
  
      index_points = np.random.uniform(-1.0, 1.0, (6, 2)).astype(
          np.float64
      )
  
      kernel = exponentiated_quadratic.ExponentiatedQuadratic(
          amplitude, length_scale
      )
      multi_task_kernel = multitask_kernel.Independent(
          num_tasks=num_tasks, base_kernel=kernel
      )
  
      precomputed_mtgprm = mtgprm_lib.MultiTaskGaussianProcessRegressionModel.precompute_regression_model(
          kernel=multi_task_kernel,
          index_points=index_points,
          observation_index_points=observation_index_points,
          observations=observations,
          observation_noise_variance=observation_noise_variance,
          validate_args=True,
      )
  
      flat = tf.nest.flatten(precomputed_mtgprm, expand_composites=True)
      unflat = tf.nest.pack_sequence_as(
          precomputed_mtgprm, flat, expand_composites=True
      )
      self.assertIsInstance(
          unflat, mtgprm_lib.MultiTaskGaussianProcessRegressionModel
      )
      self.assertIsInstance(unflat, tf.__internal__.CompositeTensor)
      # Check that we don't recompute the scale matrix on flattening /
      # unflattening. In this case it's a kronecker product of a lower triangular
      # and an identity, so we only check the first factor.
      self.assertIs(
          precomputed_mtgprm._observation_scale.operators[
              0
          ]._tril,  # pylint:disable=protected-access
          unflat._observation_scale.operators[0]._tril,
      )
  
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 12 for calling the MultiTaskGaussianProcessRegressionModelTest obj's underlying member method code with example usage: obj.testPrecomputedCompositeTensor() without return types