def pad_same(width, kernel, slide):
    """Given width, kernel size and slide, compute how 
    to pad to make output same as input"""
    res = (width - kernel) / slide + 1
    pad = (width - res) / 2
    return pad