class_docstr: A tuple representing a batch of whole episodes.
  
  Data type for on-policy algorithms.
  
  A :class:`~EpisodeBatch` represents a batch of whole episodes, produced
  when one or more agents interacts with one or more environments.
  
  +-----------------------+-------------------------------------------------+
  | Symbol                | Description                                     |
  +=======================+=================================================+
  | :math:`N`             | Episode batch dimension                         |
  +-----------------------+-------------------------------------------------+
  | :math:`[T]`           | Variable-length time dimension of each          |
  |                       | episode                                         |
  +-----------------------+-------------------------------------------------+
  | :math:`S^*`           | Single-step shape of a time-series tensor       |
  +-----------------------+-------------------------------------------------+
  | :math:`N \bullet [T]` | A dimension computed by flattening a            |
  |                       | variable-length time dimension :math:`[T]` into |
  |                       | a single batch dimension with length            |
  |                       | :math:`sum_{i \in N} [T]_i`                     |
  +-----------------------+-------------------------------------------------+
  
  Attributes:
      env_spec (EnvSpec): Specification for the environment from
          which this data was sampled.
      episode_infos (dict[str, np.ndarray]): A dict of numpy arrays
          containing the episode-level information of each episode. Each
          value of this dict should be a numpy array of shape :math:`(N,
          S^*)`. For example, in goal-conditioned reinforcement learning this
          could contain the goal state for each episode.
      observations (numpy.ndarray): A numpy array of shape
          :math:`(N \bullet [T], O^*)` containing the (possibly
          multi-dimensional) observations for all time steps in this batch.
          These must conform to :obj:`EnvStep.observation_space`.
      last_observations (numpy.ndarray): A numpy array of shape
          :math:`(N, O^*)` containing the last observation of each episode.
          This is necessary since there are one more observations than
          actions every episode.
      actions (numpy.ndarray): A  numpy array of shape
          :math:`(N \bullet [T], A^*)` containing the (possibly
          multi-dimensional) actions for all time steps in this batch. These
          must conform to :obj:`EnvStep.action_space`.
      rewards (numpy.ndarray): A numpy array of shape
          :math:`(N \bullet [T])` containing the rewards for all time steps
          in this batch.
      env_infos (dict[str, np.ndarray]): A dict of numpy arrays arbitrary
          environment state information. Each value of this dict should be
          a numpy array of shape :math:`(N \bullet [T])` or :math:`(N \bullet
          [T], S^*)`.
      agent_infos (dict[str, np.ndarray]): A dict of numpy arrays arbitrary
          agent state information. Each value of this dict should be a numpy
          array of shape :math:`(N \bullet [T])` or :math:`(N \bullet [T],
          S^*)`.  For example, this may contain the hidden states from an RNN
          policy.
      step_types (numpy.ndarray): A numpy array of `StepType with shape
          :math:`(N \bullet [T])` containing the time step types for all
          transitions in this batch.
      lengths (numpy.ndarray): An integer numpy array of shape :math:`(N,)`
          containing the length of each episode in this batch. This may be
          used to reconstruct the individual episodes.
  
  Raises:
      ValueError: If any of the above attributes do not conform to their
          prescribed types and shapes.
class_docstr_tok: ["A","tuple","representing","a","batch","of","whole","episodes",".","Data","type","for","on-policy","algorithms",".","A",":","class",":","`","~EpisodeBatch","`","represents","a","batch","of","whole","episodes",",","produced","when","one","or","more","agents","interacts","with","one","or","more","environments",".","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","Symbol","|","Description","|","+=======================+=================================================+","|",":","math",":","`","N","`","|","Episode","batch","dimension","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|",":","math",":","`","[","T","]","`","|","Variable-length","time","dimension","of","each","|","|","|","episode","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|",":","math",":","`","S^","*","`","|","Single-step","shape","of","a","time-series","tensor","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|",":","math",":","`","N","\\bullet","[","T","]","`","|","A","dimension","computed","by","flattening","a","|","|","|","variable-length","time","dimension",":","math",":","`","[","T","]","`","into","|","|","|","a","single","batch","dimension","with","length","|","|","|",":","math",":","`","sum_","{","i","\\in","N","}","[","T","]","_i","`","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","Attributes",":","env_spec","(","EnvSpec",")",":","Specification","for","the","environment","from","which","this","data","was","sampled",".","episode_infos","(","dict","[","str",",","np.ndarray","]",")",":","A","dict","of","numpy","arrays","containing","the","episode-level","information","of","each","episode",".","Each","value","of","this","dict","should","be","a","numpy","array","of","shape",":","math",":","`","(","N",",","S^","*",")","`",".","For","example",",","in","goal-conditioned","reinforcement","learning","this","could","contain","the","goal","state","for","each","episode",".","observations","(","numpy.ndarray",")",":","A","numpy","array","of","shape",":","math",":","`","(","N","\\bullet","[","T","]",",","O^","*",")","`","containing","the","(","possibly","multi-dimensional",")","observations","for","all","time","steps","in","this","batch",".","These","must","conform","to",":","obj",":","`","EnvStep.observation_space","`",".","last_observations","(","numpy.ndarray",")",":","A","numpy","array","of","shape",":","math",":","`","(","N",",","O^","*",")","`","containing","the","last","observation","of","each","episode",".","This","is","necessary","since","there","are","one","more","observations","than","actions","every","episode",".","actions","(","numpy.ndarray",")",":","A","numpy","array","of","shape",":","math",":","`","(","N","\\bullet","[","T","]",",","A^","*",")","`","containing","the","(","possibly","multi-dimensional",")","actions","for","all","time","steps","in","this","batch",".","These","must","conform","to",":","obj",":","`","EnvStep.action_space","`",".","rewards","(","numpy.ndarray",")",":","A","numpy","array","of","shape",":","math",":","`","(","N","\\bullet","[","T","]",")","`","containing","the","rewards","for","all","time","steps","in","this","batch",".","env_infos","(","dict","[","str",",","np.ndarray","]",")",":","A","dict","of","numpy","arrays","arbitrary","environment","state","information",".","Each","value","of","this","dict","should","be","a","numpy","array","of","shape",":","math",":","`","(","N","\\bullet","[","T","]",")","`","or",":","math",":","`","(","N","\\bullet","[","T","]",",","S^","*",")","`",".","agent_infos","(","dict","[","str",",","np.ndarray","]",")",":","A","dict","of","numpy","arrays","arbitrary","agent","state","information",".","Each","value","of","this","dict","should","be","a","numpy","array","of","shape",":","math",":","`","(","N","\\bullet","[","T","]",")","`","or",":","math",":","`","(","N","\\bullet","[","T","]",",","S^","*",")","`",".","For","example",",","this","may","contain","the","hidden","states","from","an","RNN","policy",".","step_types","(","numpy.ndarray",")",":","A","numpy","array","of","`","StepType","with","shape",":","math",":","`","(","N","\\bullet","[","T","]",")","`","containing","the","time","step","types","for","all","transitions","in","this","batch",".","lengths","(","numpy.ndarray",")",":","An","integer","numpy","array","of","shape",":","math",":","`","(","N",",",")","`","containing","the","length","of","each","episode","in","this","batch",".","This","may","be","used","to","reconstruct","the","individual","episodes",".","Raises",":","ValueError",":","If","any","of","the","above","attributes","do","not","conform","to","their","prescribed","types","and","shapes","."]
docstr: Padded env infos.
  
  Returns:
      dict[str, np.ndarray]: Padded env infos. Each value must have
          shape with :math:`(N, max_episode_length)` or
          :math:`(N, max_episode_length, S^*)`.
docstr_tok: ["Padded","env","infos",".","Returns",":","dict","[","str",",","np.ndarray","]",":","Padded","env","infos",".","Each","value","must","have","shape","with",":","math",":","`","(","N",",","max_episode_length",")","`","or",":","math",":","`","(","N",",","max_episode_length",",","S^","*",")","`","."]
code: def padded_env_infos(self):
      """Padded env infos.
  
      Returns:
          dict[str, np.ndarray]: Padded env infos. Each value must have
              shape with :math:`(N, max_episode_length)` or
              :math:`(N, max_episode_length, S^*)`.
  
      """
      return {
          k: pad_batch_array(
              arr, self.lengths, self.env_spec.max_episode_length
          )
          for (k, arr) in self.env_infos.items()
      }
  
imports: from dataclasses import dataclass
  import enum
  from typing import Dict, List
  import warnings
  import numpy
  from garage.np import concat_tensor_dict_list, pad_batch_array, slice_nested_dict, stack_tensor_dict_list
label_desc: Use image node_id 18 for calling the EpisodeBatch obj's underlying member method code with example usage: obj.padded_env_infos() and returns: unknown