def validate_pred_label(pred_label: torch.Tensor | None) -> torch.Tensor | None:
        """Validate prediction label.

        Args:
            pred_label (torch.Tensor | None): Input prediction label or ``None``.

        Returns:
            torch.Tensor | None: Validated boolean prediction label or ``None``.

        Raises:
            TypeError: If ``pred_label`` is not a ``torch.Tensor``.
            ValueError: If prediction label is not a scalar.

        Examples:
            >>> import torch
            >>> from anomalib.data.validators import VideoValidator
            >>> label = torch.tensor(1)
            >>> validated = VideoValidator.validate_pred_label(label)
            >>> validated
            tensor(True)
        """
        if pred_label is None:
            return None
        if not isinstance(pred_label, torch.Tensor):
            try:
                pred_label = torch.tensor(pred_label)
            except Exception as e:
                msg = "Failed to convert pred_label to a torch.Tensor."
                raise ValueError(msg) from e
        pred_label = pred_label.squeeze()
        if pred_label.ndim != 0:
            msg = f"Predicted label must be a scalar, got shape {pred_label.shape}."
            raise ValueError(msg)
        return pred_label.to(torch.bool)
Validate prediction label.

        Args:
            pred_label (torch.Tensor | None): Input prediction label or ``None``.

        Returns:
            torch.Tensor | None: Validated boolean prediction label or ``None``.

        Raises:
            TypeError: If ``pred_label`` is not a ``torch.Tensor``.
            ValueError: If prediction label is not a scalar.

        Examples:
            >>> import torch
            >>> from anomalib.data.validators import VideoValidator
            >>> label = torch.tensor(1)
            >>> validated = VideoValidator.validate_pred_label(label)
            >>> validated
            tensor(True)
        
src/anomalib/data/validators/torch/video.py