'Compute along 1 dimension, with these sizes, what will be the output dimension.
Arguments:
X (int): input data dimension
S (int): filter dimension
padding (int): padding on each side
strides (int): striding
pooling (bool): flag for setting pooling layer size
dilation (int): dilation of filter'

def output_dim(self, X, S, padding, strides, pooling=False, dilation=1):

    S = ((dilation * (S - 1)) + 1)
    if (self.check_caffe_compat() and pooling):
        size = (int(ceil((float(((X - S) + (2 * padding))) / strides))) + 1)
        if ((padding > 0) and (((size - 1) * strides) >= (X + padding))):
            size -= 1
    else:
        size = ((((X - S) + (2 * padding)) // strides) + 1)
    if (pooling and (padding >= S)):
        raise ValueError(('Padding    dim    %d    incompatible    with    filter    size    %d' % (padding, S)))
    return size
