code: def testShapes(self):
      with self.cached_session():
          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, dist.batch_shape_tensor()
              )
              self.assertAllEqual([], dist.event_shape)
              self.assertAllEqual([], dist.event_shape_tensor())
              self.assertEqual(10, dist.event_size.eval())
              # event_size is available as a constant because the shape is
              # known at graph build time.
              self.assertEqual(
                  10, tensor_util.constant_value(dist.event_size)
              )
  
          for batch_shape in ([], [1], [2, 3, 4]):
              dist = make_categorical(
                  batch_shape,
                  constant_op.constant(10, dtype=dtypes.int32),
              )
              self.assertAllEqual(
                  len(batch_shape), dist.batch_shape.ndims
              )
              self.assertAllEqual(
                  batch_shape, dist.batch_shape_tensor()
              )
              self.assertAllEqual([], dist.event_shape)
              self.assertAllEqual([], dist.event_shape_tensor())
              self.assertEqual(10, dist.event_size.eval())
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.distributions import categorical
  from tensorflow.python.ops.distributions import kullback_leibler
  from tensorflow.python.ops.distributions import normal
  from tensorflow.python.platform import test
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