def validate_image(image: Video) -> Video:
        """Validate the video batch tensor.

        Validates that the input video batch tensor has the correct dimensions, number of
        channels and data type. Converts the tensor to float32 and scales values to [0,1]
        range.

        Args:
            image (Video): Input video batch tensor. Should be either:
                - Shape ``(B,C,H,W)`` for single frame images
                - Shape ``(B,T,C,H,W)`` for multi-frame videos
                Where:
                    - ``B`` is batch size
                    - ``T`` is number of frames
                    - ``C`` is number of channels (1 or 3)
                    - ``H`` is height
                    - ``W`` is width

        Returns:
            Video: Validated and normalized video batch tensor.

        Raises:
            TypeError: If ``image`` is not a ``torch.Tensor``.
            ValueError: If tensor dimensions or channel count are invalid.

        Examples:
            >>> import torch
            >>> from torchvision.tv_tensors import Video
            >>> from anomalib.data.validators import VideoBatchValidator
            >>> # Create sample video batch with 2 videos, 10 frames each
            >>> video_batch = Video(torch.rand(2, 10, 3, 224, 224))
            >>> validated_batch = VideoBatchValidator.validate_image(video_batch)
            >>> print(validated_batch.shape)
            torch.Size([2, 10, 3, 224, 224])
        """
        if not isinstance(image, torch.Tensor):
            msg = f"Video batch must be a torch.Tensor, got {type(image)}."
            raise TypeError(msg)

        if image.dim() not in {4, 5}:  # (B, C, H, W) or (B, T, C, H, W)
            msg = (
                "Video batch must have 4 dimensions (B, C, H, W) for single frame images "
                f"or 5 dimensions (B, T, C, H, W) for multi-frame videos, got {image.dim()}."
            )
            raise ValueError(msg)

        if image.dim() == 5 and image.shape[2] not in {1, 3}:
            msg = f"Video batch must have 1 or 3 channels, got {image.shape[2]}."
            raise ValueError(msg)
        if image.dim() == 4 and image.shape[1] not in {1, 3}:
            msg = f"Image batch must have 1 or 3 channels, got {image.shape[1]}."
            raise ValueError(msg)

        return to_dtype_image(image, torch.float32, scale=True)
Validate the video batch tensor.

        Validates that the input video batch tensor has the correct dimensions, number of
        channels and data type. Converts the tensor to float32 and scales values to [0,1]
        range.

        Args:
            image (Video): Input video batch tensor. Should be either:
                - Shape ``(B,C,H,W)`` for single frame images
                - Shape ``(B,T,C,H,W)`` for multi-frame videos
                Where:
                    - ``B`` is batch size
                    - ``T`` is number of frames
                    - ``C`` is number of channels (1 or 3)
                    - ``H`` is height
                    - ``W`` is width

        Returns:
            Video: Validated and normalized video batch tensor.

        Raises:
            TypeError: If ``image`` is not a ``torch.Tensor``.
            ValueError: If tensor dimensions or channel count are invalid.

        Examples:
            >>> import torch
            >>> from torchvision.tv_tensors import Video
            >>> from anomalib.data.validators import VideoBatchValidator
            >>> # Create sample video batch with 2 videos, 10 frames each
            >>> video_batch = Video(torch.rand(2, 10, 3, 224, 224))
            >>> validated_batch = VideoBatchValidator.validate_image(video_batch)
            >>> print(validated_batch.shape)
            torch.Size([2, 10, 3, 224, 224])
        
src/anomalib/data/validators/torch/video.py