class_docstr: A compact implementation of a simplified Rainbow agent.
class_docstr_tok: ["A","compact","implementation","of","a","simplified","Rainbow","agent","."]
docstr: Creates the replay buffer used by the agent.
  
  Args:
    use_staging: bool, if True, uses a staging area to prefetch data for
      faster training.
  
  Returns:
    A `WrappedPrioritizedReplayBuffer` object.
  
  Raises:
    ValueError: if given an invalid replay scheme.
docstr_tok: ["Creates","the","replay","buffer","used","by","the","agent",".","Args",":","use_staging",":","bool",",","if","True",",","uses","a","staging","area","to","prefetch","data","for","faster","training",".","Returns",":","A","`","WrappedPrioritizedReplayBuffer","`","object",".","Raises",":","ValueError",":","if","given","an","invalid","replay","scheme","."]
code: def _build_replay_buffer(self, use_staging):
      """Creates the replay buffer used by the agent.
  
      Args:
        use_staging: bool, if True, uses a staging area to prefetch data for
          faster training.
  
      Returns:
        A `WrappedPrioritizedReplayBuffer` object.
  
      Raises:
        ValueError: if given an invalid replay scheme.
      """
      if self._replay_scheme not in ["uniform", "prioritized"]:
          raise ValueError(
              "Invalid replay scheme: {}".format(self._replay_scheme)
          )
      # Both replay schemes use the same data structure, but the 'uniform' scheme
      # sets all priorities to the same value (which yields uniform sampling).
      return prioritized_replay_buffer.WrappedPrioritizedReplayBuffer(
          observation_shape=self.observation_shape,
          stack_size=self.stack_size,
          use_staging=use_staging,
          update_horizon=self.update_horizon,
          gamma=self.gamma,
          observation_dtype=self.observation_dtype.as_numpy_dtype,
      )
  
file_path: dopamine/dopamine/agents/rainbow/rainbow_agent.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from dopamine.agents.dqn import dqn_agent
  from dopamine.discrete_domains import atari_lib
  from dopamine.replay_memory import prioritized_replay_buffer
  import gin.tf
  import tensorflow
label_desc: Use image node_id 3 for calling the RainbowAgent obj's underlying member method code with example usage: obj._build_replay_buffer(use_staging) and returns: prioritized_replay_buffer