code: def testInfoSpec(self, dtype):
      action_spec = [
          tensor_spec.BoundedTensorSpec((2, 3), dtype, -10, 10),
          tensor_spec.BoundedTensorSpec((1, 2), dtype, -10, 10),
      ]
      info_spec = [
          tensor_spec.TensorSpec([1], dtype=tf.float32, name="loc"),
          tensor_spec.TensorSpec([1], dtype=tf.float32, name="scale"),
      ]
      time_step_spec, time_step = self.create_time_step()
      policy = random_tf_policy.RandomTFPolicy(
          time_step_spec=time_step_spec,
          action_spec=action_spec,
          info_spec=info_spec,
      )
  
      # Test without batch
      action_step = policy.action(time_step)
      tf.nest.assert_same_structure(action_spec, action_step.action)
      self.assertEqual(
          (
              2,
              3,
          ),
          action_step.action[0].shape,
      )
      self.assertEqual(
          (
              1,
              2,
          ),
          action_step.action[1].shape,
      )
      tf.nest.assert_same_structure(info_spec, action_step.info)
      self.assertEqual((1,), action_step.info[0].shape)
      self.assertEqual((1,), action_step.info[1].shape)
  
      # Test with batch, we should see the additional outer batch dim for both
      # `action` and `info`.
      batch_size = 2
      batched_time_step = self.create_batch(time_step, batch_size)
      batched_action_step = policy.action(batched_time_step)
      tf.nest.assert_same_structure(
          action_spec, batched_action_step.action
      )
      self.assertEqual(
          (
              batch_size,
              2,
              3,
          ),
          batched_action_step.action[0].shape,
      )
      self.assertEqual(
          (
              batch_size,
              1,
              2,
          ),
          batched_action_step.action[1].shape,
      )
      tf.nest.assert_same_structure(info_spec, batched_action_step.info)
      self.assertEqual(
          (
              batch_size,
              1,
          ),
          batched_action_step.info[0].shape,
      )
      self.assertEqual(
          (
              batch_size,
              1,
          ),
          batched_action_step.info[1].shape,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tf_agents.bandits.specs import utils
  from tf_agents.policies import random_tf_policy
  from tf_agents.policies import utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.utils import nest_utils
  from tf_agents.utils import test_utils
label_desc: Use image node_id 11 for calling the RandomTFPolicyTest obj's underlying member method code with example usage: obj.testInfoSpec(dtype) without return types