def update(self, anomaly_maps: torch.Tensor, masks: torch.Tensor) -> None:
        """Update metric state with new predictions and targets.

        Args:
            anomaly_maps: Model predictions as float tensors of shape
                ``(N, H, W)``
            masks: Ground truth binary masks of shape ``(N, H, W)``

        Raises:
            ValueError: If inputs have invalid shapes or types
        """
        _validate.is_anomaly_maps(anomaly_maps)
        _validate.is_masks(masks)
        _validate.is_same_shape(anomaly_maps, masks)
        self.anomaly_maps.append(anomaly_maps)
        self.masks.append(masks)
Update metric state with new predictions and targets.

        Args:
            anomaly_maps: Model predictions as float tensors of shape
                ``(N, H, W)``
            masks: Ground truth binary masks of shape ``(N, H, W)``

        Raises:
            ValueError: If inputs have invalid shapes or types
        
src/anomalib/metrics/pimo/pimo.py