def validate_gt_label(label: int | torch.Tensor | None) -> torch.Tensor | None:
        """Validate ground truth label.

        Validates and converts ground truth labels to boolean tensors.

        Args:
            label (int | torch.Tensor | None): Input label as either:
                - Integer (0 or 1)
                - Boolean tensor
                - Integer tensor
                - ``None``

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

        Raises:
            TypeError: If ``label`` is not an integer, tensor or ``None``.
            ValueError: If label shape or dtype is invalid.

        Examples:
            >>> import torch
            >>> from anomalib.data.validators import VideoValidator
            >>> # Integer label
            >>> validated = VideoValidator.validate_gt_label(1)
            >>> validated
            tensor(True)

            >>> # Tensor label
            >>> label = torch.tensor([0, 0], dtype=torch.int32)
            >>> validated = VideoValidator.validate_gt_label(label)
            >>> validated
            tensor([False, False])
        """
        if label is None:
            return None
        if isinstance(label, int):
            label = torch.tensor(label)
        if not isinstance(label, torch.Tensor):
            msg = f"Ground truth label must be an integer or a torch.Tensor, got {type(label)}."
            raise TypeError(msg)
        if torch.is_floating_point(label):
            msg = f"Ground truth label must be boolean or integer, got {label.dtype}."
            raise TypeError(msg)
        return label.bool()
Validate ground truth label.

        Validates and converts ground truth labels to boolean tensors.

        Args:
            label (int | torch.Tensor | None): Input label as either:
                - Integer (0 or 1)
                - Boolean tensor
                - Integer tensor
                - ``None``

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

        Raises:
            TypeError: If ``label`` is not an integer, tensor or ``None``.
            ValueError: If label shape or dtype is invalid.

        Examples:
            >>> import torch
            >>> from anomalib.data.validators import VideoValidator
            >>> # Integer label
            >>> validated = VideoValidator.validate_gt_label(1)
            >>> validated
            tensor(True)

            >>> # Tensor label
            >>> label = torch.tensor([0, 0], dtype=torch.int32)
            >>> validated = VideoValidator.validate_gt_label(label)
            >>> validated
            tensor([False, False])
        
src/anomalib/data/validators/torch/video.py