class_docstr: This replay buffer implements a FIFO queue.
  
  Sometimes, e.g. for offline use cases, it may be desirable to use
  off-policy algorithms without a Replay Buffer.
  This FifoReplayBuffer can be used in-place to achieve the same effect
  without having to introduce separate algorithm execution branches.
  
  For simplicity and efficiency reasons, this replay buffer stores incoming
  sample batches as-is, and returns them one at time.
  This is to avoid any additional load when this replay buffer is used.
class_docstr_tok: ["This","replay","buffer","implements","a","FIFO","queue",".","Sometimes",",","e.g",".","for","offline","use","cases",",","it","may","be","desirable","to","use","off-policy","algorithms","without","a","Replay","Buffer",".","This","FifoReplayBuffer","can","be","used","in-place","to","achieve","the","same","effect","without","having","to","introduce","separate","algorithm","execution","branches",".","For","simplicity","and","efficiency","reasons",",","this","replay","buffer","stores","incoming","sample","batches","as-is",",","and","returns","them","one","at","time",".","This","is","to","avoid","any","additional","load","when","this","replay","buffer","is","used","."]
docstr: Sample a saved training batch from this buffer.
  
  Args:
      ``*args``   : Forward compatibility args.
      ``**kwargs``: Forward compatibility kwargs.
  
  Returns:
      A single training batch from the queue.
docstr_tok: ["Sample","a","saved","training","batch","from","this","buffer",".","Args",":","``","*","args","``",":","Forward","compatibility","args",".","``","*","*","kwargs","``",":","Forward","compatibility","kwargs",".","Returns",":","A","single","training","batch","from","the","queue","."]
code: def sample(self, *args, **kwargs) -> Optional[SampleBatchType]:
      """Sample a saved training batch from this buffer.
  
      Args:
          ``*args``   : Forward compatibility args.
          ``**kwargs``: Forward compatibility kwargs.
  
      Returns:
          A single training batch from the queue.
      """
      if len(self._queue) <= 0:
          # Return empty SampleBatch if queue is empty.
          return MultiAgentBatch({}, 0)
      batch = self._queue.pop(0)
      # Equal weights of 1.0.
      batch["weights"] = np.ones(len(batch))
      return batch
  
file_path: ray/python/ray/rllib/utils/replay_buffers/fifo_replay_buffer.py
imports: import numpy
  from typing import Any, Dict, Optional
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.replay_buffers.replay_buffer import ReplayBuffer, StorageUnit
  from ray.rllib.utils.typing import SampleBatchType
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 3 for calling the FifoReplayBuffer obj's underlying member method code with example usage: obj.sample() and returns: batch, MultiAgentBatch