class_docstr: Ensures common frames are only stored once to optimize memory use.
  
  To further reduce the memory use, it is optionally to turn on lz4 to compress the observations.
  
  Note:
      This object should only be converted to numpy array just before forward pass.
class_docstr_tok: ["Ensures","common","frames","are","only","stored","once","to","optimize","memory","use",".","To","further","reduce","the","memory","use",",","it","is","optionally","to","turn","on","lz4","to","compress","the","observations",".","Note",":","This","object","should","only","be","converted","to","numpy","array","just","before","forward","pass","."]
docstr: Lazyframe for a set of frames and if to apply lz4.
  
  Args:
      frames (list): The frames to convert to lazy frames
      lz4_compress (bool): Use lz4 to compress the frames internally
  
  Raises:
      DependencyNotInstalled: lz4 is not installed
docstr_tok: ["Lazyframe","for","a","set","of","frames","and","if","to","apply","lz4",".","Args",":","frames","(","list",")",":","The","frames","to","convert","to","lazy","frames","lz4_compress","(","bool",")",":","Use","lz4","to","compress","the","frames","internally","Raises",":","DependencyNotInstalled",":","lz4","is","not","installed"]
code: def __init__(self, frames: list, lz4_compress: bool = False):
      """Lazyframe for a set of frames and if to apply lz4.
  
      Args:
          frames (list): The frames to convert to lazy frames
          lz4_compress (bool): Use lz4 to compress the frames internally
  
      Raises:
          DependencyNotInstalled: lz4 is not installed
      """
      self.frame_shape = tuple(frames[0].shape)
      self.shape = (len(frames),) + self.frame_shape
      self.dtype = frames[0].dtype
      if lz4_compress:
          try:
              from lz4.block import compress
          except ImportError:
              raise DependencyNotInstalled(
                  "lz4 is not installed, run `pip install gym[other]`"
              )
  
          frames = [compress(frame) for frame in frames]
      self._frames = frames
      self.lz4_compress = lz4_compress
  
file_path: gym/gym/wrappers/frame_stack.py
imports: from collections import deque
  from typing import Union
  import numpy
  import gym
  from gym.error import DependencyNotInstalled
  from gym.spaces import Box
label_desc: Use image node_id 1 to create a new LazyFrames object  with example: obj = LazyFrames(frames, lz4_compress)