class_docstr: A compact implementation of agents for Atari 100k.
docstr: Records an observation and update state.
  
  Extracts a frame from the observation vector and overwrites the oldest
  frame in the state buffer.
  
  Args:
    observation: numpy array, an observation from the environment.
docstr_tok: ["Records","an","observation","and","update","state",".","Extracts","a","frame","from","the","observation","vector","and","overwrites","the","oldest","frame","in","the","state","buffer",".","Args",":","observation",":","numpy","array",",","an","observation","from","the","environment","."]
code: def _record_observation(self, observation):
      """Records an observation and update state.
  
      Extracts a frame from the observation vector and overwrites the oldest
      frame in the state buffer.
  
      Args:
        observation: numpy array, an observation from the environment.
      """
      # Set current observation. We do the reshaping to handle environments
      # without frame stacking.
      observation = observation.squeeze(-1)
      if len(observation.shape) == len(self.observation_shape):
          self._observation = onp.reshape(
              observation, self.observation_shape
          )
      else:
          self._observation = onp.reshape(
              observation,
              (observation.shape[0], *self.observation_shape),
          )
      # Swap out the oldest frame with the current frame.
      self.state = onp.roll(self.state, -1, axis=-1)
      self.state[..., -1] = self._observation
  
imports: import copy
  import functools
  from absl import logging
  from dopamine.jax import networks
  from dopamine.jax.agents.full_rainbow import full_rainbow_agent
  import gin
  import jax
  import jax.numpy
  import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling the Atari100kRainbowAgent obj's underlying member method code with example usage: obj._record_observation(observation) without return types