def store_transition(self, frame, action, reward, done, extra_info=None):
self.current_idx = (self.current_idx + <NUM_LIT:1>) % self.buffer_capacity<EOL>if self.frame_stack_compensation:<EOL><INDENT>idx_range = np.arange(-frame.shape[-<NUM_LIT:1>] // self.frame_history, <NUM_LIT:0>)<EOL>frame = np.take(frame, indices=idx_range, axis=-<NUM_LIT:1>)<EOL><DEDENT>self.state_buffer[self.current_idx] = frame<EOL>self.action_buffer[self.current_idx] = action<EOL>self.reward_buffer[self.current_idx] = reward<EOL>self.dones_buffer[self.current_idx] = done<EOL>if extra_info is not None:<EOL><INDENT>for name in extra_info:<EOL><INDENT>if name not in self.extra_data:<EOL><INDENT>assert self.current_size == <NUM_LIT:0>, f"<STR_LIT>"<EOL>array = extra_info[name]<EOL>self.extra_data[name] = np.zeros([self.buffer_capacity] + list(array.shape), dtype=array.dtype)<EOL><DEDENT>self.extra_data[name][self.current_idx] = extra_info[name]<EOL><DEDENT><DEDENT>if self.current_size < self.buffer_capacity:<EOL><INDENT>self.current_size += <NUM_LIT:1><EOL><DEDENT>return self.current_idx<EOL>
Store given transition in the backend