class_docstr: Tests :class:`texar.tf.modules.CategoricalPolicyNet`.
      
class_docstr_tok: ["Tests",":","class",":","`","texar.tf.modules.CategoricalPolicyNet","`","."]
docstr: Tests logics.
          
docstr_tok: ["Tests","logics","."]
code: def test_categorical_policy(self):
      """Tests logics."""
      policy = CategoricalPolicyNet()
  
      inputs = tf.random_uniform(shape=[1, 4])
      outputs = policy(inputs=inputs)
      self.assertEqual(
          list(outputs["action"].shape[1:]),
          list(policy.action_space.shape),
      )
      self.assertIsInstance(outputs["dist"], tfpd.Categorical)
  
      inputs = tf.random_uniform(shape=[64, 4])
      outputs = policy(inputs=inputs)
      self.assertEqual(
          list(outputs["action"].shape[1:]),
          list(policy.action_space.shape),
      )
      self.assertEqual(int(outputs["action"].shape[0]), 64)
  
imports: import tensorflow
  from tensorflow_probability import distributions
  from texar.tf.modules.policies.policy_nets import CategoricalPolicyNet
label_desc: Use image node_id 1 for calling the CategoricalPolicyNetTest obj's underlying member method code with example usage: obj.test_categorical_policy() without return types