'Allocate output buffer to store activations from fprop.
Arguments:
shared_outputs (Tensor, optional): pre-allocated tensor for activations to be
computed into'

def allocate(self, shared_outputs=None):

    assert self.owns_output
    o_shape_pad = (self.o_shape[0], (self.o_shape[1] + 2))
    self.h_buffer_all = self.be.iobuf(self.hidden_shape, shared=shared_outputs, parallelism=self.parallelism)
    step_size = (self.h_buffer_all.shape[1] // (self.nsteps + 2))
    self.outputs = self.h_buffer_all[:, step_size:(- step_size)]
    super(BiRNN, self).allocate(shared_outputs)
    nout = self.o_shape[0]
    self.h_buffer = self.outputs
    self.out_deltas_buffer = self.deltas
    self.h_buffer_f = self.h_buffer[:nout]
    self.h_prev_buffer = self.h_buffer_all[:nout, :(- (2 * step_size))]
    self.h_f_last = self.h_prev_buffer[:, :step_size]
    self.h_f = get_steps(self.h_buffer_all[:nout, :], o_shape_pad)[1:(-1)]
    self.h_prev = get_steps(self.h_buffer_all[:nout, :], o_shape_pad)[:(-2)]
    self.h_buffer_b = self.h_buffer[nout:]
    self.h_next_buffer = self.h_buffer_all[nout:, (2 * step_size):]
    self.h_b_last = self.h_next_buffer[:, (- step_size):]
    self.h_b = get_steps(self.h_buffer_all[nout:, :], o_shape_pad)[1:(-1)]
    self.h_next = get_steps(self.h_buffer_all[nout:, :], o_shape_pad)[2:]
    self.bufs_to_reset = [self.h_buffer]
    self.prev_in_deltas_last = self.be.empty_like(self.h_f[(-1)])
    self.next_in_deltas_last = self.be.empty_like(self.h_b[0])
    if (self.W_input is None):
        self.init_params(self.weight_shape)
