def fit(self, embeddings: Array, targets: Array) -> None:
        """
        Fits a Multivariate Gaussian to the training data using class-specific means and 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.
        """
        (
            self._classwise_mean_features,
            self._classwise_cov_features,
        ) = compute_classwise_mean_and_cov(embeddings, targets, self.num_classes)
        self._gmm_logpdf_fn = _get_logpdf_fn(
            self._classwise_mean_features, self._classwise_cov_features
        )

        Fits a Multivariate Gaussian to the training data using class-specific means and 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/ddu.py