def compute_maps(
        self,
        batch: torch.Tensor,
        student_output: torch.Tensor,
        distance_st: torch.Tensor,
        normalize: bool = True,
    ) -> tuple[torch.Tensor, torch.Tensor]:
        """Compute anomaly maps from model outputs.

        Args:
            batch (torch.Tensor): Input batch of images.
            student_output (torch.Tensor): Student network output features.
            distance_st (torch.Tensor): Student-teacher distances.
            normalize (bool): Whether to normalize maps with pre-computed
                quantiles. Defaults to ``True``.

        Returns:
            tuple[torch.Tensor, torch.Tensor]:
                - Student-teacher anomaly map
                - Student-autoencoder anomaly map
        """
        image_size = batch.shape[-2:]
        # Eval mode.
        with torch.no_grad():
            ae_output = self.ae(batch, image_size)

            map_st = torch.mean(distance_st, dim=1, keepdim=True)
            map_stae = torch.mean(
                (ae_output - student_output[:, self.teacher_out_channels :]) ** 2,
                dim=1,
                keepdim=True,
            )

        if self.pad_maps:
            map_st = F.pad(map_st, (4, 4, 4, 4))
            map_stae = F.pad(map_stae, (4, 4, 4, 4))
        map_st = F.interpolate(map_st, size=image_size, mode="bilinear")
        map_stae = F.interpolate(map_stae, size=image_size, mode="bilinear")

        if self.is_set(self.quantiles) and normalize:
            map_st = 0.1 * (map_st - self.quantiles["qa_st"]) / (self.quantiles["qb_st"] - self.quantiles["qa_st"])
            map_stae = 0.1 * (map_stae - self.quantiles["qa_ae"]) / (self.quantiles["qb_ae"] - self.quantiles["qa_ae"])
        return map_st, map_stae
Compute anomaly maps from model outputs.

        Args:
            batch (torch.Tensor): Input batch of images.
            student_output (torch.Tensor): Student network output features.
            distance_st (torch.Tensor): Student-teacher distances.
            normalize (bool): Whether to normalize maps with pre-computed
                quantiles. Defaults to ``True``.

        Returns:
            tuple[torch.Tensor, torch.Tensor]:
                - Student-teacher anomaly map
                - Student-autoencoder anomaly map
        
src/anomalib/models/image/efficient_ad/torch_model.py