def get_padding_same(kernel_size, dilation_rate):
    """
    SAME padding implementation given kernel_size and dilation_rate.
    The calculation formula as following:
        (F-(k+(k -1)*(r-1))+2*p)/s + 1 = F_new
        where F: a feature map
              k: kernel size, r: dilation rate, p: padding value, s: stride
              F_new: new feature map 
    Args:
        kernel_size (int)
        dilation_rate (int)

    Returns:
        padding_same (int): padding value
    """
    k = kernel_size
    r = dilation_rate
    padding_same = (k + (k - 1) * (r - 1) - 1)//2 

    return padding_same