def fit(self, embeddings: Array, targets: Array) -> None:
        """
        Fits a Multivariate Gaussian to the training data using class-specific means and a shared covariance matrix.

        Parameters
        ----------
        embeddings: Array
            The embeddings of shape `(n, d)` where `n` is the number of training samples and `d` is the embbeding's size.
        targets: Array
            An array of length `n` containing, for each input sample, its ground-truth label.
        """
        n_labels_observed = len(jnp.unique(targets))
        if n_labels_observed != self.num_classes:
            logging.warning(
                f"{self.num_classes} labels were expected but found {n_labels_observed} in the provided train set. "
                f"Will proceed but performance may be hurt by this."
            )

        self._mean, self._cov = compute_mean_and_joint_cov(
            embeddings, targets, jnp.arange(self.num_classes)
        )

        Fits a Multivariate Gaussian to the training data using class-specific means and a shared covariance matrix.

        Parameters
        ----------
        embeddings: Array
            The embeddings of shape `(n, d)` where `n` is the number of training samples and `d` is the embbeding's size.
        targets: Array
            An array of length `n` containing, for each input sample, its ground-truth label.
        
fortuna/ood_detection/mahalanobis.py