code: def testShape(self):
      for dist in (
          self.make_two_piece_normal(),
          self.make_two_piece_normals(),
      ):
          expected_batch_shape = dist.skewness.shape
          self.assertEqual(
              list(self.evaluate(dist.batch_shape_tensor())),
              list(expected_batch_shape),
          )
          self.assertEqual(dist.batch_shape, expected_batch_shape)
          self.assertAllEqual(
              self.evaluate(dist.event_shape_tensor()), []
          )
          self.assertEqual(dist.event_shape, tf.TensorShape([]))
  
          n = 10
          sample = dist.sample(n, seed=test_util.test_seed())
          results = [sample]
  
          for method in (
              "prob",
              "cdf",
              "survival_function",
              "log_prob",
              "log_cdf",
              "log_survival_function",
          ):
              results.append(getattr(dist, method)(sample))
  
          probs = dist.cdf(sample)
          results.append(dist.quantile(probs))
  
          for result in results:
              self.assertAllEqual(
                  [n] + list(self.evaluate(dist.batch_shape_tensor())),
                  result.shape,
              )
              self.assertAllEqual(
                  [n] + list(self.evaluate(dist.batch_shape_tensor())),
                  self.evaluate(result).shape,
              )
              self.assertAllEqual([n] + dist.batch_shape, result.shape)
              self.assertAllEqual(
                  [n] + dist.batch_shape, self.evaluate(result).shape
              )
  
          for method in ("mean", "variance", "mode"):
              result = getattr(dist, method)()
              self.assertAllEqual(
                  self.evaluate(dist.batch_shape_tensor()), result.shape
              )
              self.assertAllEqual(
                  self.evaluate(dist.batch_shape_tensor()),
                  self.evaluate(result).shape,
              )
              self.assertAllEqual(dist.batch_shape, result.shape)
              self.assertAllEqual(
                  dist.batch_shape, self.evaluate(result).shape
              )
  
imports: import itertools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import two_piece_normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 8 for calling the _TwoPieceNormalTest obj's underlying member method code with example usage: obj.testShape() without return types