code: def testInstantiate(self):
      df = np.float64(1.0)
      # 5x5 grid of index points in R^2 and flatten to 25x2
      index_points = np.linspace(-4.0, 4.0, 5, dtype=np.float64)
      index_points = np.stack(
          np.meshgrid(index_points, index_points), axis=-1
      )
      index_points = np.reshape(index_points, [-1, 2])
      # ==> shape = [25, 2]
  
      # Kernel with batch_shape [2, 4, 1, 3]
      amplitude = np.array([1.0, 2.0], np.float64).reshape([2, 1, 1, 1])
      length_scale = np.array([0.1, 0.2, 0.3, 0.4], np.float64).reshape(
          [1, 4, 1, 1]
      )
      observation_noise_variance = np.array(
          [1e-5, 1e-6, 1e-9], np.float64
      ).reshape([1, 1, 1, 3])
  
      observation_index_points = np.random.uniform(
          -1.0, 1.0, (3, 7, 2)
      ).astype(np.float64)
      observations = np.random.uniform(-1.0, 1.0, (3, 7)).astype(
          np.float64
      )
  
      def cholesky_fn(x):
          return tf.linalg.cholesky(
              tf.linalg.set_diag(x, tf.linalg.diag_part(x) + 1.0)
          )
  
      kernel = exponentiated_quadratic.ExponentiatedQuadratic(
          amplitude, length_scale
      )
      dist = stprm.StudentTProcessRegressionModel(
          df=df,
          kernel=kernel,
          index_points=index_points,
          observation_index_points=observation_index_points,
          observations=observations,
          observation_noise_variance=observation_noise_variance,
          cholesky_fn=cholesky_fn,
      )
      batch_shape = [2, 4, 1, 3]
      event_shape = [25]
      sample_shape = [7, 2]
  
      self.assertIs(cholesky_fn, dist.cholesky_fn)
  
      samples = dist.sample(sample_shape, seed=test_util.test_seed())
      self.assertAllEqual(dist.batch_shape_tensor(), batch_shape)
      self.assertAllEqual(dist.event_shape_tensor(), event_shape)
      self.assertAllEqual(
          self.evaluate(samples).shape,
          sample_shape + batch_shape + event_shape,
      )
  
imports: from unittest import mock
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import gaussian_process_regression_model
  from tensorflow_probability.python.distributions import student_t_process
  from tensorflow_probability.python.distributions import student_t_process_regression_model
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import exp_sin_squared
  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 1 for calling the StudentTProcessRegressionModelTest obj's underlying member method code with example usage: obj.testInstantiate() and returns: tf