def forward(self, batch: torch.Tensor) -> torch.Tensor | InferenceBatch:
        """Compute anomaly predictions from input images.

        Args:
            batch (torch.Tensor): Input images with shape
                ``(batch_size, clip_len,channels, height, width)``.

        Returns:
            Union[torch.Tensor, InferenceBatch]: Model predictions. During
                training returns features tensor. During inference returns
                ``InferenceBatch`` with prediction scores and anomaly maps.
        """
        feature_vector, feature_shapes = self.get_features(batch)
        anomaly_map = None
        pred_score, anomaly_map = self.compute_scores(feature_vector, feature_shapes)
        if anomaly_map is not None:
            anomaly_map_with_c = torch.unsqueeze(anomaly_map, 1).to(batch.device)
            anomaly_map_stack = F.interpolate(
                anomaly_map_with_c,
                size=batch.shape[-2:],
                mode="bilinear",
                align_corners=False,
            )
            anomaly_map_stack = anomaly_map_stack.to(batch.device)
        pred_score = pred_score.to(batch.device)
        return InferenceBatch(pred_score=pred_score, anomaly_map=anomaly_map_stack)
Compute anomaly predictions from input images.

        Args:
            batch (torch.Tensor): Input images with shape
                ``(batch_size, clip_len,channels, height, width)``.

        Returns:
            Union[torch.Tensor, InferenceBatch]: Model predictions. During
                training returns features tensor. During inference returns
                ``InferenceBatch`` with prediction scores and anomaly maps.
        
src/anomalib/models/video/fuvas/torch_model.py