def __init__(self, buffer_shapes, size_in_transitions, T, sample_transitions):
self.buffer_shapes = buffer_shapes<EOL>self.size = size_in_transitions // T<EOL>self.T = T<EOL>self.sample_transitions = sample_transitions<EOL>self.buffers = {key: np.empty([self.size, *shape])<EOL>for key, shape in buffer_shapes.items()}<EOL>self.current_size = <NUM_LIT:0><EOL>self.n_transitions_stored = <NUM_LIT:0><EOL>self.lock = threading.Lock()<EOL>
Creates a replay buffer.

        Args:
            buffer_shapes (dict of ints): the shape for all buffers that are used in the replay
                buffer
            size_in_transitions (int): the size of the buffer, measured in transitions
            T (int): the time horizon for episodes
            sample_transitions (function): a function that samples from the replay buffer