class_docstr: Replay buffer for off policy learning.
  
  :param buffer_size: The maximum buffer size.
  :param seed: The random seed used for initializing the uniform random sampling in the buffer.
class_docstr_tok: ["Replay","buffer","for","off","policy","learning",".",":","param","buffer_size",":","The","maximum","buffer","size",".",":","param","seed",":","The","random","seed","used","for","initializing","the","uniform","random","sampling","in","the","buffer","."]
docstr: implementation of :class:`~maze.train.trainers.common.replay_buffer.replay_buffer.BaseReplayBuffer`
          
docstr_tok: ["implementation","of",":","class",":","`","~maze.train.trainers.common.replay_buffer.replay_buffer.BaseReplayBuffer","`"]
code: def sample_batch(
      self, n_samples: int, learner_device: str
  ) -> List[Union[StructuredSpacesRecord, SpacesTrajectoryRecord]]:
      """implementation of :class:`~maze.train.trainers.common.replay_buffer.replay_buffer.BaseReplayBuffer`"""
      indices = self.buffer_rng.permutation(len(self))[:n_samples]
      sample_batch = self._buffer[indices]
      self._total_samples_count += len(indices)
      self.cum_moving_avg_num_picks = float(
          self._total_samples_count
      ) / float(self._total_number_of_transitions)
      return sample_batch
  
file_path: maze/maze/train/trainers/common/replay_buffer/uniform_replay_buffer.py
imports: from typing import Union, List
  import numpy
  from maze.core.annotations import override
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.core.trajectory_recording.records.trajectory_record import SpacesTrajectoryRecord
  from maze.train.trainers.common.replay_buffer.replay_buffer import BaseReplayBuffer
label_desc: Use image node_id 4 for calling the UniformReplayBuffer obj's underlying member method code with example usage: obj.sample_batch(n_samples, learner_device) and returns: sample_batch