code: def testShapes(self):
      for batch_shape in ([], [1], [2, 3, 4]):
          dist = make_categorical(batch_shape, 10)
          self.assertAllEqual(batch_shape, dist.batch_shape)
          self.assertAllEqual(
              batch_shape, self.evaluate(dist.batch_shape_tensor())
          )
          self.assertAllEqual([], dist.event_shape)
          self.assertAllEqual(
              [], self.evaluate(dist.event_shape_tensor())
          )
          num_categories = tf.shape(
              dist.probs if dist.logits is None else dist.logits
          )[-1]
          self.assertEqual(10, self.evaluate(num_categories))
          # The number of categories is available as a constant because the shape is
          # known at graph build time.
          num_categories = prefer_static.shape(
              dist.probs if dist.logits is None else dist.logits
          )[-1]
          self.assertEqual(10, tf.get_static_value(num_categories))
  
      for batch_shape in ([], [1], [2, 3, 4]):
          dist = make_categorical(
              batch_shape, tf.constant(10, dtype=tf.int32)
          )
          self.assertAllEqual(
              len(batch_shape), tensorshape_util.rank(dist.batch_shape)
          )
          self.assertAllEqual(
              batch_shape, self.evaluate(dist.batch_shape_tensor())
          )
          self.assertAllEqual([], dist.event_shape)
          self.assertAllEqual(
              [], self.evaluate(dist.event_shape_tensor())
          )
          num_categories = tf.shape(
              dist.probs if dist.logits is None else dist.logits
          )[-1]
          self.assertEqual(10, self.evaluate(num_categories))
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import prefer_static
  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.util import deferred_tensor
label_desc: Use image node_id 3 for calling the CategoricalTest obj's underlying member method code with example usage: obj.testShapes() without return types