def test_untile_overlapping_patches(
    image_size: tuple,
    kernel_size: int,
    stride: int,
    remove_border_count: int,
    mode: ImageUpscaleMode,
) -> None:
    """Overlapping Tiling/Untiling should return the same image size."""
    tiler = Tiler(
        tile_size=kernel_size,
        stride=stride,
        remove_border_count=remove_border_count,
        mode=mode,
    )

    image = torch.rand(image_size)
    tiles = tiler.tile(image)
    reconstructed_image = tiler.untile(tiles)
    image = image[
        :,
        :,
        remove_border_count:-remove_border_count,
        remove_border_count:-remove_border_count,
    ]
    reconstructed_image = reconstructed_image[
        :,
        :,
        remove_border_count:-remove_border_count,
        remove_border_count:-remove_border_count,
    ]
    assert torch.equal(image, reconstructed_image)
Overlapping Tiling/Untiling should return the same image size.
tests/unit/data/utils/test_tiler.py