code: def testShapes(self):
      # 5x5 grid of index points in R^2 and flatten to 25x2
      index_points = np.linspace(-4.0, 4.0, 5, dtype=np.float32)
      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]
      df = np.array(
          [[3.0, 4.0, 5.0, 4.0], [7.5, 8, 5.0, 5.0]], dtype=np.float32
      ).reshape([2, 4, 1])
      observation_noise_variance = np.array(
          [1e-5, 1e-6, 1e-5], np.float32
      ).reshape([3, 1, 1, 1])
      amplitude = np.array([1.0, 2.0], np.float32).reshape([2, 1, 1])
      length_scale = np.array([1.0, 2.0, 3.0, 4.0], np.float32).reshape(
          [1, 4, 1]
      )
      batched_index_points = np.stack([index_points] * 6)
      # ==> shape = [6, 25, 2]
      if not self.is_static:
          df = tf1.placeholder_with_default(df, shape=None)
          amplitude = tf1.placeholder_with_default(
              amplitude, shape=None
          )
          length_scale = tf1.placeholder_with_default(
              length_scale, shape=None
          )
          batched_index_points = tf1.placeholder_with_default(
              batched_index_points, shape=None
          )
      kernel = psd_kernels.ExponentiatedQuadratic(
          amplitude, length_scale
      )
      tp = student_t_process.StudentTProcess(
          df,
          kernel,
          batched_index_points,
          observation_noise_variance=observation_noise_variance,
          validate_args=True,
      )
  
      batch_shape = [3, 2, 4, 6]
      event_shape = [25]
      sample_shape = [5, 3]
  
      samples = tp.sample(sample_shape, seed=test_util.test_seed())
  
      if self.is_static or tf.executing_eagerly():
          self.assertAllEqual(tp.batch_shape_tensor(), batch_shape)
          self.assertAllEqual(tp.event_shape_tensor(), event_shape)
          self.assertAllEqual(
              samples.shape, sample_shape + batch_shape + event_shape
          )
          self.assertAllEqual(tp.batch_shape, batch_shape)
          self.assertAllEqual(tp.event_shape, event_shape)
          self.assertAllEqual(
              samples.shape, sample_shape + batch_shape + event_shape
          )
          self.assertAllEqual(
              tp.mean().shape, batch_shape + event_shape
          )
          self.assertAllEqual(
              tp.variance().shape, batch_shape + event_shape
          )
      else:
          self.assertAllEqual(
              self.evaluate(tp.batch_shape_tensor()), batch_shape
          )
          self.assertAllEqual(
              self.evaluate(tp.event_shape_tensor()), event_shape
          )
          self.assertAllEqual(
              self.evaluate(samples).shape,
              sample_shape + batch_shape + event_shape,
          )
          self.assertIsNone(tensorshape_util.rank(samples.shape))
          self.assertIsNone(tensorshape_util.rank(tp.batch_shape))
          self.assertEqual(tensorshape_util.rank(tp.event_shape), 1)
          self.assertIsNone(
              tf.compat.dimension_value(
                  tensorshape_util.dims(tp.event_shape)[0]
              )
          )
          self.assertAllEqual(
              self.evaluate(tf.shape(tp.mean())),
              batch_shape + event_shape,
          )
          self.assertAllEqual(
              self.evaluate(tf.shape(tp.variance())),
              batch_shape + event_shape,
          )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import multivariate_student_t
  from tensorflow_probability.python.distributions import student_t_process
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math import psd_kernels
  from tensorflow_probability.python.math.psd_kernels.internal import test_util
label_desc: Use image node_id 1 for calling the _StudentTProcessTest obj's underlying member method code with example usage: obj.testShapes() without return types