docstr: Buffer observations and stack across channels (last axis).
docstr_tok: ["Buffer","observations","and","stack","across","channels","(","last","axis",")","."]
code: def __init__(self, env, k):
      """Buffer observations and stack across channels (last axis)."""
      gym.Wrapper.__init__(self, env)
      self.k = k
      self.frames = deque([], maxlen=k)
      shp = env.observation_space.shape
      chan = 1 if len(shp) == 2 else shp[2]
      self.observation_space = spaces.Box(
          low=0,
          high=255,
          shape=(shp[0], shp[1], chan * k),
          dtype=np.uint8,
      )
  
imports: import gym
  import numpy
  from collections import deque
  from gym import spaces
label_desc: Use image node_id 1 to create a new FrameStack object from inherited base classes: gym with example: obj = FrameStack(env, k)