class_docstr: Batch of environments inside the TensorFlow graph.
  
  The batch of environments will be stepped and reset inside of the graph using
  a tf.py_func(). The current batch of observations, actions, rewards, and done
  flags are held in according variables.
class_docstr_tok: ["Batch","of","environments","inside","the","TensorFlow","graph",".","The","batch","of","environments","will","be","stepped","and","reset","inside","of","the","graph","using","a","tf.py_func","(",")",".","The","current","batch","of","observations",",","actions",",","rewards",",","and","done","flags","are","held","in","according","variables","."]
docstr: Step the batch of environments.
  
  The results of the step can be accessed from the variables defined below.
  
  Args:
    action: Tensor holding the batch of actions to apply.
  
  Returns:
    Operation.
docstr_tok: ["Step","the","batch","of","environments",".","The","results","of","the","step","can","be","accessed","from","the","variables","defined","below",".","Args",":","action",":","Tensor","holding","the","batch","of","actions","to","apply",".","Returns",":","Operation","."]
code: def simulate(self, action):
      """Step the batch of environments.
  
      The results of the step can be accessed from the variables defined below.
  
      Args:
        action: Tensor holding the batch of actions to apply.
  
      Returns:
        Operation.
      """
      with tf.name_scope("environment/simulate"):
          if action.dtype in (tf.float16, tf.float32, tf.float64):
              action = tf.check_numerics(action, "action")
  
          def step(action):
              step_response = self._batch_env.step(action)
              # Current env doesn't return `info`, but EnvProblem does.
              # TODO(afrozm): The proper way to do this is to make T2TGymEnv return
              # an empty info return value.
              if len(step_response) == 3:
                  (observ, reward, done) = step_response
              else:
                  (observ, reward, done, _) = step_response
              return (observ, reward.astype(np.float32), done)
  
          observ, reward, done = tf.py_func(
              step,
              [action],
              [self.observ_dtype, tf.float32, tf.bool],
              name="step",
          )
          reward = tf.check_numerics(reward, "reward")
          reward.set_shape((len(self),))
          done.set_shape((len(self),))
          with tf.control_dependencies([self._observ.assign(observ)]):
              return tf.identity(reward), tf.identity(done)
  
file_path: tensor2tensor/tensor2tensor/rl/envs/py_func_batch_env.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.rl.envs.in_graph_batch_env import InGraphBatchEnv
  import tensorflow.compat.v1
label_desc: Use image node_id 7 for calling the PyFuncBatchEnv obj's underlying member method code with example usage: obj.simulate(action) and returns: observ,  reward,  done, tf,  tf