class_docstr: Abstract interface for all replay buffer implementations.
docstr: Sample mini-batch randomly from the buffer.
  
  :param n_samples: The number of samples to draw.
  :param learner_device: The device of the learner (cpu or cuda).
  :return: A sample batch of trajectory or spaces records
docstr_tok: ["Sample","mini-batch","randomly","from","the","buffer",".",":","param","n_samples",":","The","number","of","samples","to","draw",".",":","param","learner_device",":","The","device","of","the","learner","(","cpu","or","cuda",")",".",":","return",":","A","sample","batch","of","trajectory","or","spaces","records"]
code: def sample_batch(
      self, n_samples: int, learner_device: str
  ) -> List[Union[StructuredSpacesRecord, SpacesTrajectoryRecord]]:
      """Sample mini-batch randomly from the buffer.
  
      :param n_samples: The number of samples to draw.
      :param learner_device: The device of the learner (cpu or cuda).
      :return: A sample batch of trajectory or spaces records
      """
  
file_path: maze/maze/train/trainers/common/replay_buffer/replay_buffer.py
imports: from abc import abstractmethod
  from typing import Union, List
  import numpy
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.core.trajectory_recording.records.trajectory_record import SpacesTrajectoryRecord
label_desc: Use image node_id 2 for calling the BaseReplayBuffer obj's underlying member method code with example usage: obj.sample_batch(n_samples, learner_device) without return types