def is_anomaly_maps(anomaly_maps: Tensor) -> None:
    """Validate anomaly maps tensor.

    Args:
        anomaly_maps: Tensor of shape (N, H, W) containing anomaly scores.

    Raises:
        ValueError: If tensor does not have 3 dimensions.
        TypeError: If tensor is not floating point.

    Example:
        >>> maps = torch.randn(10, 32, 32)
        >>> is_anomaly_maps(maps)  # No error
        >>> bad_maps = torch.zeros(10, 32, 32, dtype=torch.long)
        >>> is_anomaly_maps(bad_maps)  # Raises TypeError
    """
    if anomaly_maps.ndim != 3:
        msg = f"Expected anomaly maps have 3 dimensions (N, H, W), but got {anomaly_maps.ndim} dimensions"
        raise ValueError(msg)

    if not anomaly_maps.dtype.is_floating_point:
        msg = (
            "Expected anomaly maps to be an floating Tensor with anomaly scores,"
            f" but got Tensor with dtype {anomaly_maps.dtype}"
        )
        raise TypeError(msg)
Validate anomaly maps tensor.

    Args:
        anomaly_maps: Tensor of shape (N, H, W) containing anomaly scores.

    Raises:
        ValueError: If tensor does not have 3 dimensions.
        TypeError: If tensor is not floating point.

    Example:
        >>> maps = torch.randn(10, 32, 32)
        >>> is_anomaly_maps(maps)  # No error
        >>> bad_maps = torch.zeros(10, 32, 32, dtype=torch.long)
        >>> is_anomaly_maps(bad_maps)  # Raises TypeError
    
src/anomalib/metrics/pimo/_validate.py