def _compute_anomaly_scores(z_dists: torch.Tensor) -> torch.Tensor:
        """Get anomaly scores from the latent distribution.

        Args:
            z_dists (torch.Tensor): Latent distribution.

        Returns:
            Tensor: Anomaly scores.
        """
        # z_dist is a 3 length list of tensors with shape b x 304 x fx x fy
        flat_maps = [z_dist.reshape(z_dist.shape[0], -1) for z_dist in z_dists]
        flat_maps_tensor = torch.cat(flat_maps, dim=1)
        return torch.mean(flat_maps_tensor**2 / 2, dim=1)
Get anomaly scores from the latent distribution.

        Args:
            z_dists (torch.Tensor): Latent distribution.

        Returns:
            Tensor: Anomaly scores.
        
src/anomalib/models/image/csflow/torch_model.py