def METHOD_NAME():
    """Test that expected warnings and errors are raised."""
    with pytest.warns(
        UserWarning,
        match="Metric `Kernel Inception Distance` will save all extracted features in buffer."
        " For large datasets this may lead to large memory footprint.",
    ):
        KernelInceptionDistance()
    if _TORCH_FIDELITY_AVAILABLE:
        with pytest.raises(ValueError, match="Integer input to argument `feature` must be one of .*"):
            KernelInceptionDistance(feature=2)
    else:
        with pytest.raises(
            ModuleNotFoundError,
            match="Kernel Inception Distance metric requires that `Torch-fidelity` is installed."
            " Either install as `pip install torchmetrics[image]` or `pip install torch-fidelity`.",
        ):
            KernelInceptionDistance()
    with pytest.raises(TypeError, match="Got unknown input to argument `feature`"):
        KernelInceptionDistance(feature=[1, 2])
    m = KernelInceptionDistance()
    m.update(torch.randint(0, 255, (5, 3, 299, 299), dtype=torch.uint8), real=True)
    m.update(torch.randint(0, 255, (5, 3, 299, 299), dtype=torch.uint8), real=False)
    with pytest.raises(ValueError, match="Argument `subset_size` should be smaller than the number of samples"):
        m.compute()