'Forward propagate pooling layer.
Arguments:
layer (PoolLayer): The pool layer object, different backends have
different pool layers.
I (Tensor): Input tensor.
O (Tensor): output tensor.
denom (Tensor): denominator tensor, stores the result of the squared pooling/contrast
ascale (float): scaling parameter (alpha) to multiply the pooled sum (1.25e-5 in AK)
bpower (float): exponential parameter (beta) to raise denominator by (0.75 in AK)'

def fprop_lrn(self, layer, I, O, denom, alpha=None, beta=None, ascale=1, bpower=1):

    assert (layer.sizeI == I.size)
    assert (layer.sizeO == O.size)
    (J, T, R, S) = layer.JTRS
    (C, D, H, W, N) = layer.dimI
    (K, M, P, Q, N) = layer.dimO
    (pad_c, pad_d, pad_h, pad_w) = layer.padding
    (str_c, str_d, str_h, str_w) = layer.strides
    array_I = I._tensor.reshape(layer.dimI)
    array_O = O._tensor.reshape(layer.dimO)
    array_d = denom._tensor.reshape(layer.dimO)
    for k in range(K):
        (sliceC, _) = layer.kSlice[k]
        _ascale = (ascale / J)
        for m in range(M):
            (sliceD, _) = layer.mSlice[m]
            for p in range(P):
                (sliceH, _) = layer.pSlice[p]
                for q in range(Q):
                    (sliceW, _) = layer.qSlice[q]
                    sliceI = array_I[sliceC, sliceD, sliceH, sliceW, :].reshape((-1), N)
                    array_d[k, m, p, q, :] = (1 + (_ascale * np.sum(np.square(sliceI), axis=0)))
    array_O[:] = (array_I * np.power(array_d, (- bpower)))
