class_docstr: A replay buffer that stores and can sample whole episodes.
  
  This buffer only stores valid steps, and doesn't require paths to
  have a maximum length.
  
  Args:
      capacity_in_transitions (int): Total memory allocated for the buffer.
      env_spec (EnvSpec): Environment specification.
class_docstr_tok: ["A","replay","buffer","that","stores","and","can","sample","whole","episodes",".","This","buffer","only","stores","valid","steps",",","and","does","n't","require","paths","to","have","a","maximum","length",".","Args",":","capacity_in_transitions","(","int",")",":","Total","memory","allocated","for","the","buffer",".","env_spec","(","EnvSpec",")",":","Environment","specification","."]
docstr: Sample a single path from the buffer.
  
  Returns:
      path: A dict of arrays of shape (path_len, flat_dim).
docstr_tok: ["Sample","a","single","path","from","the","buffer",".","Returns",":","path",":","A","dict","of","arrays","of","shape","(","path_len",",","flat_dim",")","."]
code: def sample_path(self):
      """Sample a single path from the buffer.
  
      Returns:
          path: A dict of arrays of shape (path_len, flat_dim).
  
      """
      path_idx = np.random.randint(len(self._path_segments))
      first_seg, second_seg = self._path_segments[path_idx]
      first_seg_indices = np.arange(first_seg.start, first_seg.stop)
      second_seg_indices = np.arange(second_seg.start, second_seg.stop)
      indices = np.concatenate([first_seg_indices, second_seg_indices])
      path = {
          key: buf_arr[indices] for key, buf_arr in self._buffer.items()
      }
      return path
  
file_path: garage/src/garage/replay_buffer/path_buffer.py
imports: import collections
  import numpy
  from garage import StepType, TimeStepBatch
label_desc: Use image node_id 4 for calling the PathBuffer obj's underlying member method code with example usage: obj.sample_path() and returns: path