def get_same_padding_for_kernel_size(kernel_size):
    """
    Returns the required padding for "same" style convolutions
    """
    if kernel_size % 2 == 0:
        raise ValueError(f"Only odd sized kernels are supported, got {kernel_size}")
    return (kernel_size - 1) // 2