def compute(self) -> torch.Tensor:
        """Compute the metric value.

        If the metric has not been updated, and metric is not in strict mode, return None.

        Returns:
            torch.Tensor: Computed metric value or None.
        """
        if self._update_count == 0 and not self.strict:  # type: ignore[attr-defined]
            return None
        return super().compute()  # type: ignore[misc]
Compute the metric value.

        If the metric has not been updated, and metric is not in strict mode, return None.

        Returns:
            torch.Tensor: Computed metric value or None.
        
src/anomalib/metrics/base.py