class_docstr: Abstract base class for TF RL environments.
  
  The `current_time_step()` method returns current `time_step`, resetting the
  environment if necessary.
  
  The `step(action)` method applies the action and returns the new `time_step`.
  This method will also reset the environment if needed and ignore the action in
  that case.
  
  The `reset()` method returns `time_step` that results from an environment
  reset and is guaranteed to have step_type=ts.FIRST
  
  The `reset()` method is only needed for explicit resets. In general, the
  environment will reset automatically when needed, for example, when no
  episode was started or when it reaches a step after the end of the episode
  (i.e. step_type=ts.LAST).
  
  Example for collecting an episode in eager mode:
  
    tf_env = TFEnvironment()
  
    # reset() creates the initial time_step and resets the environment.
    time_step = tf_env.reset()
    while not time_step.is_last():
      action_step = policy.action(time_step)
      time_step = tf_env.step(action_step.action)
  
  Example of simple use in graph mode:
  
    tf_env = TFEnvironment()
  
    # current_time_step() creates the initial TimeStep.
    time_step = tf_env.current_time_step()
    action_step = policy.action(time_step)
    # Apply the action and return the new TimeStep.
    next_time_step = tf_env.step(action_step.action)
  
    sess.run([time_step, action_step, next_time_step])
  
  Example with explicit resets in graph mode:
  
    reset_op = tf_env.reset()
    time_step = tf_env.current_time_step()
    action_step = policy.action(time_step)
    # Apply the action and return the new TimeStep.
    next_time_step = tf_env.step(action_step.action)
  
    # The environment will initialize before starting.
    sess.run([time_step, action_step, next_time_step])
    # This will force reset the Environment.
    sess.run(reset_op)
    # This will apply a new action in the environment.
    sess.run([time_step, action_step, next_time_step])
  
  Example of random actions in graph mode:
  
    tf_env = TFEnvironment()
  
    # Action needs to depend on the time_step using control_dependencies.
    time_step = tf_env.current_time_step()
    with tf.control_dependencies([time_step.step_type]):
      action = tensor_spec.sample_bounded_spec(tf_env.action_spec())
    next_time_step = tf_env.step(action)
  
    sess.run([time_step, action, next_time_step])
  
  Example of collecting full episodes with a while_loop:
  
    tf_env = TFEnvironment()
  
    # reset() creates the initial time_step
    time_step = tf_env.reset()
    c = lambda t: tf.logical_not(t.is_last())
    body = lambda t: [tf_env.step(t.observation)]
  
    final_time_step = tf.while_loop(c, body, [time_step])
  
    sess.run(final_time_step)
class_docstr_tok: ["Abstract","base","class","for","TF","RL","environments",".","The","`","current_time_step","(",")","`","method","returns","current","`","time_step","`",",","resetting","the","environment","if","necessary",".","The","`","step","(","action",")","`","method","applies","the","action","and","returns","the","new","`","time_step","`",".","This","method","will","also","reset","the","environment","if","needed","and","ignore","the","action","in","that","case",".","The","`","reset","(",")","`","method","returns","`","time_step","`","that","results","from","an","environment","reset","and","is","guaranteed","to","have","step_type=ts.FIRST","The","`","reset","(",")","`","method","is","only","needed","for","explicit","resets",".","In","general",",","the","environment","will","reset","automatically","when","needed",",","for","example",",","when","no","episode","was","started","or","when","it","reaches","a","step","after","the","end","of","the","episode","(","i.e",".","step_type=ts.LAST",")",".","Example","for","collecting","an","episode","in","eager","mode",":","tf_env","=","TFEnvironment","(",")","#","reset","(",")","creates","the","initial","time_step","and","resets","the","environment",".","time_step","=","tf_env.reset","(",")","while","not","time_step.is_last","(",")",":","action_step","=","policy.action","(","time_step",")","time_step","=","tf_env.step","(","action_step.action",")","Example","of","simple","use","in","graph","mode",":","tf_env","=","TFEnvironment","(",")","#","current_time_step","(",")","creates","the","initial","TimeStep",".","time_step","=","tf_env.current_time_step","(",")","action_step","=","policy.action","(","time_step",")","#","Apply","the","action","and","return","the","new","TimeStep",".","next_time_step","=","tf_env.step","(","action_step.action",")","sess.run","(","[","time_step",",","action_step",",","next_time_step","]",")","Example","with","explicit","resets","in","graph","mode",":","reset_op","=","tf_env.reset","(",")","time_step","=","tf_env.current_time_step","(",")","action_step","=","policy.action","(","time_step",")","#","Apply","the","action","and","return","the","new","TimeStep",".","next_time_step","=","tf_env.step","(","action_step.action",")","#","The","environment","will","initialize","before","starting",".","sess.run","(","[","time_step",",","action_step",",","next_time_step","]",")","#","This","will","force","reset","the","Environment",".","sess.run","(","reset_op",")","#","This","will","apply","a","new","action","in","the","environment",".","sess.run","(","[","time_step",",","action_step",",","next_time_step","]",")","Example","of","random","actions","in","graph","mode",":","tf_env","=","TFEnvironment","(",")","#","Action","needs","to","depend","on","the","time_step","using","control_dependencies",".","time_step","=","tf_env.current_time_step","(",")","with","tf.control_dependencies","(","[","time_step.step_type","]",")",":","action","=","tensor_spec.sample_bounded_spec","(","tf_env.action_spec","(",")",")","next_time_step","=","tf_env.step","(","action",")","sess.run","(","[","time_step",",","action",",","next_time_step","]",")","Example","of","collecting","full","episodes","with","a","while_loop",":","tf_env","=","TFEnvironment","(",")","#","reset","(",")","creates","the","initial","time_step","time_step","=","tf_env.reset","(",")","c","=","lambda","t",":","tf.logical_not","(","t.is_last","(",")",")","body","=","lambda","t",":","[","tf_env.step","(","t.observation",")","]","final_time_step","=","tf.while_loop","(","c",",","body",",","[","time_step","]",")","sess.run","(","final_time_step",")"]
code: def batched(self):
      return True
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import six
label_desc: Use image node_id 6 for calling the TFEnvironment obj's underlying member method code with example usage: obj.batched() and returns: True