def test_step(self, batch: Batch, batch_idx: int, *args, **kwargs) -> Batch:
        """Update min and max scores from the current step."""
        del args, kwargs  # Unused arguments.

        super().test_step(batch, batch_idx)
        self.max_scores = max(self.max_scores, torch.max(batch.pred_score))
        self.min_scores = min(self.min_scores, torch.min(batch.pred_score))
        return batch
Update min and max scores from the current step.
src/anomalib/models/image/ganomaly/lightning_model.py