def get_transitions(self, indexes):
assert indexes.shape[<NUM_LIT:1>] == self.state_buffer.shape[<NUM_LIT:1>],"<STR_LIT>"<EOL>frame_batch_shape = (<EOL>[indexes.shape[<NUM_LIT:0>], indexes.shape[<NUM_LIT:1>]]<EOL>+ list(self.state_buffer.shape[<NUM_LIT:2>:-<NUM_LIT:1>])<EOL>+ [self.state_buffer.shape[-<NUM_LIT:1>] * self.frame_history]<EOL>)<EOL>past_frame_buffer = np.zeros(frame_batch_shape, dtype=self.state_buffer.dtype)<EOL>future_frame_buffer = np.zeros(frame_batch_shape, dtype=self.state_buffer.dtype)<EOL>for buffer_idx, frame_row in enumerate(indexes):<EOL><INDENT>for env_idx, frame_idx in enumerate(frame_row):<EOL><INDENT>past_frame_buffer[buffer_idx, env_idx], future_frame_buffer[buffer_idx, env_idx] = (<EOL>self.get_frame_with_future(frame_idx, env_idx)<EOL>)<EOL><DEDENT><DEDENT>actions = take_along_axis(self.action_buffer, indexes)<EOL>rewards = take_along_axis(self.reward_buffer, indexes)<EOL>dones = take_along_axis(self.dones_buffer, indexes)<EOL>transition_tensors = {<EOL>'<STR_LIT>': past_frame_buffer,<EOL>'<STR_LIT>': actions,<EOL>'<STR_LIT>': rewards,<EOL>'<STR_LIT>': future_frame_buffer,<EOL>'<STR_LIT>': dones.astype(np.float32),<EOL>}<EOL>for name in self.extra_data:<EOL><INDENT>transition_tensors[name] = take_along_axis(self.extra_data[name], indexes)<EOL><DEDENT>return transition_tensors<EOL>
Get dictionary of transition data