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","."]
code: def __init__(self, capacity_in_transitions, env_spec=None):
      self._capacity = capacity_in_transitions
      self._env_spec = env_spec
      self._transitions_stored = 0
      self._first_idx_of_next_path = 0
      # Each path in the buffer has a tuple of two ranges in
      # self._path_segments. If the path is stored in a single contiguous
      # region of the buffer, the second range will be range(0, 0).
      # The "left" side of the deque contains the oldest episode.
      self._path_segments = collections.deque()
      self._buffer = {}
  
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 1 to create a new PathBuffer object  with example: obj = PathBuffer(capacity_in_transitions, env_spec)