code: def testGeneratesBatchedActionsWithoutSpecifyingOuterDims(self):
      action_spec = [
          array_spec.BoundedArraySpec((2, 3), np.int32, -10, 10),
          array_spec.BoundedArraySpec((1, 2), np.int32, -10, 10),
      ]
      time_step_spec = time_step.time_step_spec(
          observation_spec=array_spec.ArraySpec((1,), np.int32)
      )
      policy = random_py_policy.RandomPyPolicy(
          time_step_spec=time_step_spec, action_spec=action_spec
      )
  
      action_step = policy.action(
          time_step.restart(np.array([[1], [2], [3]], dtype=np.int32))
      )
      tf.nest.assert_same_structure(action_spec, action_step.action)
      self.assertEqual((3, 2, 3), action_step.action[0].shape)
      self.assertEqual((3, 1, 2), action_step.action[1].shape)
  
      self.assertTrue(np.all(action_step.action[0] >= -10))
      self.assertTrue(np.all(action_step.action[0] <= 10))
      self.assertTrue(np.all(action_step.action[1] >= -10))
      self.assertTrue(np.all(action_step.action[1] <= 10))
  
file_path: agents/tf_agents/policies/random_py_policy_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from tf_agents.policies import random_py_policy
  from tf_agents.specs import array_spec
  from tf_agents.trajectories import time_step
  from tf_agents.utils import test_utils
label_desc: Use image node_id 4 for calling the RandomPyPolicyTest obj's underlying member method code with example usage: obj.testGeneratesBatchedActionsWithoutSpecifyingOuterDims() without return types