def thresholds_between_0_and_1(
    num_thresholds: int = 100,
    device: torch.device | None = None,
) -> torch.Tensor:
    """Generate evenly spaced threshold values between 0 and 1.

    Args:
        num_thresholds (int, optional): Number of threshold values to generate.
            Defaults to ``100``.
        device (torch.device | None, optional): Device on which to place the
            output tensor. Defaults to ``None``.

    Returns:
        torch.Tensor: A 1D tensor of size ``num_thresholds`` containing evenly
            spaced values between ``0`` and ``1``.

    Example:
        >>> thresholds = thresholds_between_0_and_1(num_thresholds=5)
        >>> thresholds
        tensor([0.0000, 0.2500, 0.5000, 0.7500, 1.0000])
    """
    return linspace(start=0, end=1, steps=num_thresholds, device=device)
Generate evenly spaced threshold values between 0 and 1.

    Args:
        num_thresholds (int, optional): Number of threshold values to generate.
            Defaults to ``100``.
        device (torch.device | None, optional): Device on which to place the
            output tensor. Defaults to ``None``.

    Returns:
        torch.Tensor: A 1D tensor of size ``num_thresholds`` containing evenly
            spaced values between ``0`` and ``1``.

    Example:
        >>> thresholds = thresholds_between_0_and_1(num_thresholds=5)
        >>> thresholds
        tensor([0.0000, 0.2500, 0.5000, 0.7500, 1.0000])
    
src/anomalib/metrics/binning.py