docstr: A buffer for observations, actions, rewards, mu's, states, masks and dones values
  
  :param env: (Gym environment) The environment to learn from
  :param n_steps: (int) The number of steps to run for each environment
  :param size: (int) The buffer size in number of steps
code: def __init__(self, env, n_steps, size=50000):
      """
      A buffer for observations, actions, rewards, mu's, states, masks and dones values
  
      :param env: (Gym environment) The environment to learn from
      :param n_steps: (int) The number of steps to run for each environment
      :param size: (int) The buffer size in number of steps
      """
      self.n_env = env.num_envs
      self.n_steps = n_steps
      self.n_batch = self.n_env * self.n_steps
      # Each loc contains n_env * n_steps frames, thus total buffer is n_env * size frames
      self.size = size // self.n_steps
  
      if len(env.observation_space.shape) > 1:
          self.raw_pixels = True
          (
              self.height,
              self.width,
              self.n_channels,
          ) = env.observation_space.shape
          self.obs_dtype = np.uint8
      else:
          self.raw_pixels = False
          if len(env.observation_space.shape) == 1:
              self.obs_dim = env.observation_space.shape[-1]
          else:
              self.obs_dim = 1
          self.obs_dtype = np.float32
  
      # Memory
      self.enc_obs = None
      self.actions = None
      self.rewards = None
      self.mus = None
      self.dones = None
      self.masks = None
  
      # Size indexes
      self.next_idx = 0
      self.num_in_buffer = 0
  
file_path: stable-baselines/stable_baselines/acer/buffer.py
imports: import numpy
label_desc: Use image node_id 1 to create a new Buffer object from inherited base classes: object with example: obj = Buffer(env, n_steps, size)