class_docstr: VectorEnv analog to chainerrl.wrappers.atari_wrappers.FrameStack.
  
  The original `chainerrl.wrappers.atari_wrappers.FrameStack` does not work
  properly with `chainerrl.envs.MultiprocessVectorEnv` because LazyFrames
  becomes not lazy when passed between processes, unnecessarily increasing
  memory usage. To avoid the issue, use this wrapper instead of `FrameStack`
  so that LazyFrames are not passed between processes.
  
  Args:
      env (VectorEnv): Env to wrap.
      k (int): How many frames to stack.
      stack_axis (int): Axis along which frames are concatenated.
class_docstr_tok: ["VectorEnv","analog","to","chainerrl.wrappers.atari_wrappers.FrameStack",".","The","original","`","chainerrl.wrappers.atari_wrappers.FrameStack","`","does","not","work","properly","with","`","chainerrl.envs.MultiprocessVectorEnv","`","because","LazyFrames","becomes","not","lazy","when","passed","between","processes",",","unnecessarily","increasing","memory","usage",".","To","avoid","the","issue",",","use","this","wrapper","instead","of","`","FrameStack","`","so","that","LazyFrames","are","not","passed","between","processes",".","Args",":","env","(","VectorEnv",")",":","Env","to","wrap",".","k","(","int",")",":","How","many","frames","to","stack",".","stack_axis","(","int",")",":","Axis","along","which","frames","are","concatenated","."]
docstr: Stack k last frames.
docstr_tok: ["Stack","k","last","frames","."]
code: def __init__(self, env, k, stack_axis=0):
      """Stack k last frames."""
      VectorEnvWrapper.__init__(self, env)
      self.k = k
      self.stack_axis = stack_axis
      self.frames = [deque([], maxlen=k) for _ in range(env.num_envs)]
      orig_obs_space = env.observation_space
      assert isinstance(orig_obs_space, spaces.Box)
      low = np.repeat(orig_obs_space.low, k, axis=self.stack_axis)
      high = np.repeat(orig_obs_space.high, k, axis=self.stack_axis)
      self.observation_space = spaces.Box(
          low=low, high=high, dtype=orig_obs_space.dtype
      )
  
imports: from collections import deque
  from gym import spaces
  import numpy
  from chainerrl.env import VectorEnv
  from chainerrl.wrappers.atari_wrappers import LazyFrames
label_desc: Use image node_id 1 to create a new VectorFrameStack object from inherited base classes: VectorEnvWrapper with example: obj = VectorFrameStack(env, k, stack_axis)