def resize_to_be_divisible(
    input: Tensor,
    divisible_factor: int,
    interpolation: str = "bilinear",
    align_corners: Optional[bool] = None,
    side: str = "short",
    antialias: bool = False,
) -> Tensor:
    """Resize the input tensor to be divisible by a certain factor.

    Args:
        input (Tensor): Input tensor to be resized.
        divisible_factor (int): The factor to which the image should be divisible.
        interpolation (str, optional): Interpolation flag. Defaults to "bilinear".
        align_corners (Optional[bool], optional):
            whether to align the corners of the input and output. Defaults to None.
        side (str, optional): Side to resize. Defaults to "short".
        antialias (bool, optional):
            If True, then image will be filtered with Gaussian before downscaling. Defaults to False.

    Returns:
        Tensor: The resized tensor.

    """
    if isinstance(input, Tensor) and len(input.shape) == 4:
        height, width = input.shape[2], input.shape[3]
    if isinstance(input, Tensor) and len(input.shape) == 3:
        height, width = input.shape[1], input.shape[2]

    height = round(height / divisible_factor) * divisible_factor
    width = round(width / divisible_factor) * divisible_factor
    return resize(input, (height, width), interpolation, align_corners, side, antialias)
Resize the input tensor to be divisible by a certain factor.

    Args:
        input (Tensor): Input tensor to be resized.
        divisible_factor (int): The factor to which the image should be divisible.
        interpolation (str, optional): Interpolation flag. Defaults to "bilinear".
        align_corners (Optional[bool], optional):
            whether to align the corners of the input and output. Defaults to None.
        side (str, optional): Side to resize. Defaults to "short".
        antialias (bool, optional):
            If True, then image will be filtered with Gaussian before downscaling. Defaults to False.

    Returns:
        Tensor: The resized tensor.

    
kornia/geometry/transform/affwarp.py