class_docstr: Simple class for frame-stacking observations.
class_docstr_tok: ["Simple","class","for","frame-stacking","observations","."]
code: def update_spec(self, spec: dm_env_specs.Array) -> dm_env_specs.Array:
      if not self._flatten:
          new_shape = spec.shape + (self._num_frames,)
      else:
          new_shape = spec.shape[:-1] + (
              self._num_frames * spec.shape[-1],
          )
      return dm_env_specs.Array(
          shape=new_shape, dtype=spec.dtype, name=spec.name
      )
  
file_path: acme/acme/wrappers/frame_stacking.py
imports: import collections
  from acme import types
  from acme.wrappers import base
  import dm_env
  from dm_env import specs
  import numpy
  import tree
label_desc: Use image node_id 5 for calling the FrameStacker obj's underlying member method code with example usage: obj.update_spec(spec) and returns: dm_env_specs