code: def testShapes(self, is_static):
      # 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]
      batched_index_points = np.expand_dims(
          np.stack([index_points] * 6), -3
      )
      # ==> shape = [6, 1, 25, 2]
  
      # 9 inducing index points in R^2
      inducing_index_points = np.linspace(
          -4.0, 4.0, 3, dtype=np.float64
      )
      inducing_index_points = np.stack(
          np.meshgrid(inducing_index_points, inducing_index_points),
          axis=-1,
      )
      inducing_index_points = np.reshape(inducing_index_points, [-1, 2])
      # ==> shape = [9, 2]
  
      variational_inducing_observations_loc = np.zeros(
          [3, 9], dtype=np.float64
      )
      variational_inducing_observations_scale = np.eye(
          9, dtype=np.float64
      )
  
      # Kernel with batch_shape [2, 4, 1, 1]
      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]
      )
  
      jitter = np.float64(1e-6)
      observation_noise_variance = np.float64(1e-2)
  
      if not 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
          )
  
          inducing_index_points = tf1.placeholder_with_default(
              inducing_index_points, shape=None
          )
          variational_inducing_observations_loc = (
              tf1.placeholder_with_default(
                  variational_inducing_observations_loc, shape=None
              )
          )
          variational_inducing_observations_scale = (
              tf1.placeholder_with_default(
                  variational_inducing_observations_scale, shape=None
              )
          )
  
      kernel = tfpk.ExponentiatedQuadratic(amplitude, length_scale)
  
      vgp = variational_gaussian_process.VariationalGaussianProcess(
          kernel=kernel,
          index_points=batched_index_points,
          inducing_index_points=inducing_index_points,
          variational_inducing_observations_loc=(
              variational_inducing_observations_loc
          ),
          variational_inducing_observations_scale=(
              variational_inducing_observations_scale
          ),
          observation_noise_variance=observation_noise_variance,
          jitter=jitter,
      )
  
      batch_shape = [2, 4, 6, 3]
      event_shape = [25]
      sample_shape = [9, 3]
  
      samples = vgp.sample(sample_shape, seed=test_util.test_seed())
  
      if is_static or tf.executing_eagerly():
          self.assertAllEqual(
              vgp.observation_noise_variance.shape, tf.TensorShape([])
          )
          self.assertAllEqual(
              vgp.predictive_noise_variance.shape, tf.TensorShape([])
          )
          self.assertAllEqual(vgp.batch_shape_tensor(), batch_shape)
          self.assertAllEqual(vgp.event_shape_tensor(), event_shape)
          self.assertAllEqual(
              samples.shape, sample_shape + batch_shape + event_shape
          )
          self.assertAllEqual(vgp.batch_shape, batch_shape)
          self.assertAllEqual(vgp.event_shape, event_shape)
          self.assertAllEqual(
              samples.shape, sample_shape + batch_shape + event_shape
          )
      else:
          self.assertAllEqual(
              self.evaluate(tf.shape(vgp.observation_noise_variance)),
              [],
          )
          self.assertAllEqual(
              self.evaluate(tf.shape(vgp.predictive_noise_variance)), []
          )
          self.assertAllEqual(
              self.evaluate(vgp.batch_shape_tensor()), batch_shape
          )
          self.assertAllEqual(
              self.evaluate(vgp.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(vgp.batch_shape))
          self.assertEqual(tensorshape_util.rank(vgp.event_shape), 1)
          self.assertIsNone(
              tf.compat.dimension_value(
                  tensorshape_util.dims(vgp.event_shape)[0]
              )
          )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import variational_gaussian_process
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
label_desc: Use image node_id 1 for calling the VariationalGaussianProcessTest obj's underlying member method code with example usage: obj.testShapes(is_static) without return types