def _get_transitions(self, probs, indexes, tree_idxs, batch_info, forward_steps=<NUM_LIT:1>, discount_factor=<NUM_LIT:1.0>):
if forward_steps > <NUM_LIT:1>:<EOL><INDENT>transition_arrays = self.backend.get_transitions_forward_steps(indexes, forward_steps, discount_factor)<EOL><DEDENT>else:<EOL><INDENT>transition_arrays = self.backend.get_transitions(indexes)<EOL><DEDENT>priority_weight = self.priority_weight.value(batch_info['<STR_LIT>'])<EOL>probs = probs / np.array([s.total() for s in self.backend.segment_trees], dtype=float).reshape(<NUM_LIT:1>, -<NUM_LIT:1>)<EOL>capacity = self.backend.current_size<EOL>weights = (capacity * probs) ** (-priority_weight)<EOL>weights = weights / weights.max(axis=<NUM_LIT:0>, keepdims=True)<EOL>transition_arrays['<STR_LIT>'] = weights<EOL>transition_tensors = {k: torch.from_numpy(v) for k, v in transition_arrays.items()}<EOL>transitions = Trajectories(<EOL>num_steps=indexes.shape[<NUM_LIT:0>],<EOL>num_envs=indexes.shape[<NUM_LIT:1>],<EOL>environment_information=None,<EOL>transition_tensors=transition_tensors,<EOL>rollout_tensors={},<EOL>extra_data={<EOL>'<STR_LIT>': tree_idxs<EOL>}<EOL>)<EOL>return transitions.to_transitions()<EOL>
Return batch of frames for given indexes