def is_static_pad(kernel_size: int, stride: int = 1, dilation: int = 1, **_) -> bool:
    """
    Can SAME padding for given args be done statically?
    Args:
        kernel_size(`Int`):
            Convolution kernel size.
        stride(`Int`):
            Convolution stride parameter.
        dilation(`Int`):
            Convolution dilation parameter.
    Returns:
        (`Bool`): whether SAME padding can be done statically.
    """
    return stride == 1 and (dilation * (kernel_size - 1)) % 2 == 0
Can SAME padding for given args be done statically?
Args:
kernel_size(`Int`):
Convolution kernel size.
stride(`Int`):
Convolution stride parameter.
dilation(`Int`):
Convolution dilation parameter.
Returns:
(`Bool`): whether SAME padding can be done statically.
towhee/models/layers/padding_functions.py