def test_blur_equivalence(kernel_size: tuple[int, int], sigma: tuple[int, int], channels: int) -> None:
    """Test if the GaussianBlur2d layer produces the same output as Kornia's GaussianBlur2d layer."""
    for _ in range(10):
        input_tensor = torch.randn((3, channels, 128, 128))
        kornia = korniaGaussianBlur2d(kernel_size, sigma, separable=False)
        blur_kornia = kornia(input_tensor)
        gaussian = GaussianBlur2d(kernel_size=kernel_size, sigma=sigma, channels=channels)
        blur_gaussian = gaussian(input_tensor)
        torch.testing.assert_close(blur_kornia, blur_gaussian)
Test if the GaussianBlur2d layer produces the same output as Kornia's GaussianBlur2d layer.
tests/unit/models/components/test_blur.py