class_docstr: The A2C algorithm.
  
  Trains policy and value models using the A2C algortithm.
class_docstr_tok: ["The","A2C","algorithm",".","Trains","policy","and","value","models","using","the","A2C","algortithm","."]
docstr: Use the RLTask self._task to create inputs to the value model.
docstr_tok: ["Use","the","RLTask","self._task","to","create","inputs","to","the","value","model","."]
code: def batches_stream(self):
      """Use the RLTask self._task to create inputs to the value model."""
      for np_trajectory in self._task.trajectory_batch_stream(
          self._batch_size,
          max_slice_length=self._max_slice_length,
          epochs=[-1],
      ):
          # Insert an extra depth dimension, so the target shape is consistent with
          # the network output shape.
          yield (
              np_trajectory.observation,  # Inputs to the value model.
              np_trajectory.return_[:, :, None],
              np_trajectory.done[:, :, None],
              np_trajectory.reward[:, :, None],
              np_trajectory.action,
              jnp.zeros_like(np_trajectory.mask),
              np_trajectory.mask,
          )
  
imports: import functools
  from trax import data
  from trax import layers
  from trax import supervised
  from trax.fastmath import numpy
  from trax.fastmath import stop_gradient
  from trax.rl import actor_critic
  from trax.rl import distributions
  from trax.rl import rl_layers
  from trax.rl import training
  from trax.supervised import lr_schedules
label_desc: Use image node_id 2 for calling the A2CJoint obj's underlying member method code with example usage: obj.batches_stream() without return types