def div_counter(value, kernel_size, padding, stride, dilation):
    """
    Count the amount of necessary divisions based on model config,
    in order to reach 1
    """
    counter = 0
    while value > 1:
        value = (value + 2 * padding - dilation * (kernel_size - 1) - 1) // stride + 1
        counter += 1
    return counter