class_docstr: Batch together multiple py environments and act as a single batch.
  
  The environments should only access shared python variables using
  shared mutex locks (from the threading module).
class_docstr_tok: ["Batch","together","multiple","py","environments","and","act","as","a","single","batch",".","The","environments","should","only","access","shared","python","variables","using","shared","mutex","locks","(","from","the","threading","module",")","."]
docstr: Forward a batch of actions to the wrapped environments.
  
  Args:
    actions: Batched action, possibly nested, to apply to the environment.
  
  Raises:
    ValueError: Invalid actions.
  
  Returns:
    Batch of observations, rewards, and done flags.
docstr_tok: ["Forward","a","batch","of","actions","to","the","wrapped","environments",".","Args",":","actions",":","Batched","action",",","possibly","nested",",","to","apply","to","the","environment",".","Raises",":","ValueError",":","Invalid","actions",".","Returns",":","Batch","of","observations",",","rewards",",","and","done","flags","."]
code: def _step(self, actions):
      """Forward a batch of actions to the wrapped environments.
  
      Args:
        actions: Batched action, possibly nested, to apply to the environment.
  
      Raises:
        ValueError: Invalid actions.
  
      Returns:
        Batch of observations, rewards, and done flags.
      """
  
      if self._num_envs == 1:
          actions = nest_utils.unbatch_nested_array(actions)
          time_steps = self._envs[0].step(actions)
          return nest_utils.batch_nested_array(time_steps)
      else:
          unstacked_actions = unstack_actions(actions)
          if len(unstacked_actions) != self.batch_size:
              raise ValueError(
                  "Primary dimension of action items does not match "
                  "batch size: %d vs. %d"
                  % (len(unstacked_actions), self.batch_size)
              )
          time_steps = self._execute(
              lambda env_action: env_action[0].step(env_action[1]),
              zip(self._envs, unstacked_actions),
          )
          return nest_utils.stack_nested_arrays(time_steps)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from multiprocessing import dummy
  from multiprocessing import pool
  from typing import Sequence, Optional
  import gin
  import tensorflow
  from tf_agents.environments import py_environment
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 11 for calling the BatchedPyEnvironment obj's underlying member method code with example usage: obj._step(actions) and returns: nest_utils, nest_utils