code: def make_categorical(batch_shape, num_classes, dtype=dtypes.int32):
      logits = (
          random_ops.random_uniform(
              list(batch_shape) + [num_classes],
              -10,
              10,
              dtype=dtypes.float32,
          )
          - 50.0
      )
      return categorical.Categorical(logits, dtype=dtype)
  
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 1 for calling a global function with example usage: make_categorical(batch_shape, num_classes, dtype) and returns: categorical