code: def testDtype(self):
      dist = make_categorical([], 5, dtype=dtypes.int32)
      self.assertEqual(dist.dtype, dtypes.int32)
      self.assertEqual(dist.dtype, dist.sample(5).dtype)
      self.assertEqual(dist.dtype, dist.mode().dtype)
      dist = make_categorical([], 5, dtype=dtypes.int64)
      self.assertEqual(dist.dtype, dtypes.int64)
      self.assertEqual(dist.dtype, dist.sample(5).dtype)
      self.assertEqual(dist.dtype, dist.mode().dtype)
      self.assertEqual(dist.probs.dtype, dtypes.float32)
      self.assertEqual(dist.logits.dtype, dtypes.float32)
      self.assertEqual(dist.logits.dtype, dist.entropy().dtype)
      self.assertEqual(
          dist.logits.dtype,
          dist.prob(np.array(0, dtype=np.int64)).dtype,
      )
      self.assertEqual(
          dist.logits.dtype,
          dist.log_prob(np.array(0, dtype=np.int64)).dtype,
      )
      for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
          dist = make_categorical([], 5, dtype=dtype)
          self.assertEqual(dist.dtype, dtype)
          self.assertEqual(dist.dtype, dist.sample(5).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 4 for calling the CategoricalTest obj's underlying member method code with example usage: obj.testDtype() without return types