def is_scores_batch(scores_batch: torch.Tensor) -> None:
    """Validate batch of anomaly scores.

    Args:
        scores_batch: Floating point tensor of shape (N, D).

    Raises:
        TypeError: If tensor is not floating point.
        ValueError: If tensor is not 2D.

    Example:
        >>> scores = torch.randn(10, 5)  # 10 samples, 5 features
        >>> is_scores_batch(scores)  # No error
        >>> bad_scores = torch.randn(10)  # 1D tensor
        >>> is_scores_batch(bad_scores)  # Raises ValueError
    """
    if not isinstance(scores_batch, torch.Tensor):
        msg = f"Expected `scores_batch` to be an torch.Tensor, but got {type(scores_batch)}"
        raise TypeError(msg)

    if not scores_batch.dtype.is_floating_point:
        msg = (
            "Expected `scores_batch` to be an floating torch.Tensor with "
            f"anomaly scores_batch, but got torch.Tensor with dtype "
            f"{scores_batch.dtype}"
        )
        raise TypeError(msg)

    if scores_batch.ndim != 2:
        msg = f"Expected `scores_batch` to be 2D, but got {scores_batch.ndim}"
        raise ValueError(msg)
Validate batch of anomaly scores.

    Args:
        scores_batch: Floating point tensor of shape (N, D).

    Raises:
        TypeError: If tensor is not floating point.
        ValueError: If tensor is not 2D.

    Example:
        >>> scores = torch.randn(10, 5)  # 10 samples, 5 features
        >>> is_scores_batch(scores)  # No error
        >>> bad_scores = torch.randn(10)  # 1D tensor
        >>> is_scores_batch(bad_scores)  # Raises ValueError
    
src/anomalib/metrics/pimo/_validate.py