code: def testFixedPolicyBatchedOnNestedObservations(self):
      batch_size = 2
      observations = tf.constant([[1, 2], [3, 4]], dtype=tf.float32)
      time_step = ts.restart(observations, batch_size=batch_size)
      action_spec = (
          tensor_spec.TensorSpec(shape=(2,), dtype=tf.float32),
          (
              tensor_spec.TensorSpec(shape=(1,), dtype=tf.int64),
              {
                  "dict": tensor_spec.TensorSpec(
                      shape=(), dtype=tf.int32
                  )
              },
          ),
      )
      fixed_action = (
          np.array([100, 200], dtype=np.float32),
          (np.array([300], dtype=np.int64), {"dict": 400}),
      )
      policy = fixed_policy.FixedPolicy(
          fixed_action, self._time_step_spec, action_spec
      )  # pytype: disable=wrong-arg-types
      action = policy.action(time_step).action
      distribution_mode = tf.nest.map_structure(
          lambda t: t.mode(), policy.distribution(time_step).action
      )
  
      self.evaluate(tf.compat.v1.global_variables_initializer())
      expected = (
          tf.constant([[100, 200]] * batch_size, dtype=tf.float32),
          (
              tf.constant([[300]] * batch_size, dtype=tf.int64),
              {"dict": tf.constant([400] * batch_size, dtype=tf.int32)},
          ),
      )
      tf.nest.map_structure(self.assertAllEqual, action, expected)
      tf.nest.map_structure(
          self.assertAllEqual, distribution_mode, expected
      )
  
file_path: agents/tf_agents/policies/fixed_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 fixed_policy
  from tf_agents.specs import tensor_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 FixedPolicyTest obj's underlying member method code with example usage: obj.testFixedPolicyBatchedOnNestedObservations() without return types