docstr: Stack n_frames last frames.
  
  Returns lazy array, which is much more memory efficient.
  
  See Also
  --------
  stable_baselines.common.atari_wrappers.LazyFrames
  
  :param env: (Gym Environment) the environment
  :param n_frames: (int) the number of frames to stack
docstr_tok: ["Stack","n_frames","last","frames",".","Returns","lazy","array",",","which","is","much","more","memory","efficient",".","See","Also","--","--","--","--","stable_baselines.common.atari_wrappers.LazyFrames",":","param","env",":","(","Gym","Environment",")","the","environment",":","param","n_frames",":","(","int",")","the","number","of","frames","to","stack"]
code: def __init__(self, env, n_frames):
      """Stack n_frames last frames.
  
      Returns lazy array, which is much more memory efficient.
  
      See Also
      --------
      stable_baselines.common.atari_wrappers.LazyFrames
  
      :param env: (Gym Environment) the environment
      :param n_frames: (int) the number of frames to stack
      """
      gym.Wrapper.__init__(self, env)
      self.n_frames = n_frames
      self.frames = deque([], maxlen=n_frames)
      shp = env.observation_space.shape
      self.observation_space = spaces.Box(
          low=0,
          high=255,
          shape=(shp[0], shp[1], shp[2] * n_frames),
          dtype=env.observation_space.dtype,
      )
  
imports: from collections import deque
  import numpy
  import gym
  from gym import spaces
  import cv2
label_desc: Use image node_id 1 to create a new FrameStack object from inherited base classes: gym with example: obj = FrameStack(env, n_frames)