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, 3, 1]
      amplitude = np.array([1.0, 2.0], np.float32).reshape([2, 1, 1, 1])
      length_scale = np.array([1.0, 2.0, 3.0, 4.0], np.float32).reshape(
          [1, 4, 1, 1]
      )
      observation_noise_variance = np.array(
          [1e-5, 1e-6, 1e-5], np.float32
      ).reshape([1, 1, 3, 1])
      batched_index_points = np.stack([index_points] * 6)
      # ==> shape = [6, 25, 2]
      if not self.is_static:
          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
      )
      gp = gaussian_process.GaussianProcess(
          kernel,
          batched_index_points,
          observation_noise_variance=observation_noise_variance,
          jitter=1e-5,
          validate_args=True,
      )
  
      batch_shape = [2, 4, 3, 6]
      event_shape = [25]
      sample_shape = [5, 3]
  
      samples = gp.sample(sample_shape, seed=test_util.test_seed())
  
      if self.is_static or tf.executing_eagerly():
          self.assertAllEqual(gp.batch_shape_tensor(), batch_shape)
          self.assertAllEqual(gp.event_shape_tensor(), event_shape)
          self.assertAllEqual(
              samples.shape, sample_shape + batch_shape + event_shape
          )
          self.assertAllEqual(gp.batch_shape, batch_shape)
          self.assertAllEqual(gp.event_shape, event_shape)
          self.assertAllEqual(
              samples.shape, sample_shape + batch_shape + event_shape
          )
          self.assertAllEqual(
              gp.mean().shape, batch_shape + event_shape
          )
          self.assertAllEqual(
              gp.variance().shape, batch_shape + event_shape
          )
      else:
          self.assertAllEqual(
              self.evaluate(gp.batch_shape_tensor()), batch_shape
          )
          self.assertAllEqual(
              self.evaluate(gp.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(gp.batch_shape))
          self.assertEqual(tensorshape_util.rank(gp.event_shape), 1)
          self.assertIsNone(
              tf.compat.dimension_value(
                  tensorshape_util.dims(gp.event_shape)[0]
              )
          )
          self.assertAllEqual(
              self.evaluate(tf.shape(gp.mean())),
              batch_shape + event_shape,
          )
          self.assertAllEqual(
              self.evaluate(tf.shape(gp.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 gaussian_process
  from tensorflow_probability.python.distributions import gaussian_process_regression_model
  from tensorflow_probability.python.distributions import mvn_diag
  from tensorflow_probability.python.distributions import normal
  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 _GaussianProcessTest obj's underlying member method code with example usage: obj.testShapes() without return types