class_docstr: An out-of-graph Replay Buffer for Prioritized Experience Replay.
  See circular_replay_buffer.py for details.
docstr: Returns a batch of transitions with extra storage and the priorities.
  The extra storage are defined through the extra_storage_types constructor
  argument.
  When the transition is terminal next_state_batch has undefined contents.
  Args:
    batch_size: int, number of transitions returned. If None, the default
      batch_size will be used.
    indices: None or 1D tensor of ints, the indices of every transition in the
      batch. If None, sample the indices uniformly.
  Returns:
    transition_batch: tuple of np.arrays with the shape and type as in
      get_transition_elements().
code: def sample_transition_batch(self, batch_size=None, indices=None):
      """Returns a batch of transitions with extra storage and the priorities.
      The extra storage are defined through the extra_storage_types constructor
      argument.
      When the transition is terminal next_state_batch has undefined contents.
      Args:
        batch_size: int, number of transitions returned. If None, the default
          batch_size will be used.
        indices: None or 1D tensor of ints, the indices of every transition in the
          batch. If None, sample the indices uniformly.
      Returns:
        transition_batch: tuple of np.arrays with the shape and type as in
          get_transition_elements().
      """
      transition = super(
          PrioritizedReplayBuffer, self
      ).sample_transition_batch(batch_size, indices)
      # The parent returned an empty array for the probabilities. Fill it with the
      # contents of the sum tree. Note scalar values are returned as (batch_size, 1).
  
      batch_arrays = []
      for element_name in self._transition_elements:
          if element_name == "sampling_probabilities":
              batch = torch.from_numpy(
                  self.get_priority(
                      transition.indices.numpy().astype(np.int32)
                  )
              ).view(batch_size, 1)
          else:
              batch = getattr(transition, element_name)
          batch_arrays.append(batch)
  
      return self._batch_type(*batch_arrays)
  
file_path: ReAgent/reagent/replay_memory/prioritized_replay_buffer.py
imports: import numpy
  import torch
  from reagent.replay_memory import circular_replay_buffer, sum_tree
label_desc: Use image node_id 4 for calling the PrioritizedReplayBuffer obj's underlying member method code with example usage: obj.sample_transition_batch(batch_size, indices) and returns: self