def conv_shape(x, k, s, p, ceil=True):
    if (p == 'SAME'):
        output = (float(x) / float(s))
    elif (p == 'VALID'):
        output = (float(((x - k) + 1)) / float(s))
    else:
        raise Exception('Unknown padding type')
    if ceil:
        return int(np.ceil(output))
    else:
        assert output.is_integer(), 'Does not satisfy conv int requirement'
        return int(output)
def conv_shape(x, k, s, p, ceil=True):
    if (p == 'SAME'):
        output = (float(x) / float(s))
    elif (p == 'VALID'):
        output = (float(((x - k) + 1)) / float(s))
    else:
        raise Exception('Unknown padding type')
    if ceil:
        return int(np.ceil(output))
    else:
        assert output.is_integer(), 'Does not satisfy conv int requirement'
        return int(output)