def pre_process(self, image: torch.Tensor) -> torch.Tensor:
        """Pre-process the input image.

        Args:
            image (torch.Tensor): Input image tensor.

        Returns:
            torch.Tensor: Pre-processed image tensor.

        Example:
            >>> model = TorchInferencer(path="path/to/model.pt")
            >>> image = torch.rand(3, 224, 224)
            >>> processed = model.pre_process(image)
            >>> processed.shape
            torch.Size([1, 3, 224, 224])
        """
        if image.dim() == 3:
            image = image.unsqueeze(0)  # model expects [B, C, H, W]

        return image.to(self.device)
Pre-process the input image.

        Args:
            image (torch.Tensor): Input image tensor.

        Returns:
            torch.Tensor: Pre-processed image tensor.

        Example:
            >>> model = TorchInferencer(path="path/to/model.pt")
            >>> image = torch.rand(3, 224, 224)
            >>> processed = model.pre_process(image)
            >>> processed.shape
            torch.Size([1, 3, 224, 224])
        
src/anomalib/deploy/inferencers/torch_inferencer.py