class_docstr: A simple out-of-graph Replay Buffer.
  
  Stores transitions, state, action, reward, next_state, terminal (and any
  extra contents specified) in a circular buffer and provides a uniform
  transition sampling function.
  
  When the states consist of stacks of observations storing the states is
  inefficient. This class writes observations and constructs the stacked states
  at sample time.
  
  Attributes:
    add_count: int, counter of how many transitions have been added (including
      the blank ones at the beginning of an episode).
    invalid_range: np.array, an array with the indices of cursor-related invalid
      transitions
    episode_end_indices: set[int], a set of indices corresponding to the
      end of an episode.
docstr: Restores the object from bundle_dictionary and numpy checkpoints.
  
  Args:
    checkpoint_dir: str, the directory where to read the numpy checkpointed
      files from.
    suffix: str, the suffix to use in numpy checkpoint files.
  
  Raises:
    NotFoundError: If not all expected files are found in directory.
docstr_tok: ["Restores","the","object","from","bundle_dictionary","and","numpy","checkpoints",".","Args",":","checkpoint_dir",":","str",",","the","directory","where","to","read","the","numpy","checkpointed","files","from",".","suffix",":","str",",","the","suffix","to","use","in","numpy","checkpoint","files",".","Raises",":","NotFoundError",":","If","not","all","expected","files","are","found","in","directory","."]
code: def load(self, checkpoint_dir, suffix):
      """Restores the object from bundle_dictionary and numpy checkpoints.
  
      Args:
        checkpoint_dir: str, the directory where to read the numpy checkpointed
          files from.
        suffix: str, the suffix to use in numpy checkpoint files.
  
      Raises:
        NotFoundError: If not all expected files are found in directory.
      """
      save_elements = self._return_checkpointable_elements()
      skip_episode_end_indices = False
      # We will first make sure we have all the necessary files available to avoid
      # loading a partially-specified (i.e. corrupted) replay buffer.
      for attr in save_elements:
          filename = self._generate_filename(
              checkpoint_dir, attr, suffix
          )
  
          if not tf.io.gfile.exists(filename):
              if attr == "episode_end_indices":
                  logging.warning(
                      "Unable to find episode_end_indices. This is "
                      "expected for old checkpoints."
                  )
                  skip_episode_end_indices = True
                  continue
  
              raise tf.errors.NotFoundError(
                  None, None, "Missing file: {}".format(filename)
              )
      # If we've reached this point then we have verified that all expected files
      # are available.
      for attr in save_elements:
          if attr == "episode_end_indices" and skip_episode_end_indices:
              continue
  
          filename = self._generate_filename(
              checkpoint_dir, attr, suffix
          )
          with tf.io.gfile.GFile(filename, "rb") as f:
              with gzip.GzipFile(fileobj=f) as infile:
                  if attr.startswith(STORE_FILENAME_PREFIX):
                      array_name = attr[len(STORE_FILENAME_PREFIX) :]
                      self._store[array_name] = np.load(
                          infile, allow_pickle=False
                      )
                  elif isinstance(self.__dict__[attr], np.ndarray):
                      self.__dict__[attr] = np.load(
                          infile, allow_pickle=False
                      )
                  else:
                      self.__dict__[attr] = pickle.load(infile)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import gzip
  import math
  import os
  import pickle
  from absl import logging
  import gin.tf
  import numpy
  import tensorflow
label_desc: Use image node_id 27 for calling the OutOfGraphReplayBuffer obj's underlying member method code with example usage: obj.load(checkpoint_dir, suffix) without return types