def fit(self, dataset: torch.Tensor) -> None:
        """Fit PCA and Gaussian model to dataset.

        Args:
            dataset (torch.Tensor): Input dataset with shape
                ``(n_samples, n_features)``.
        """
        self.pca_model.fit(dataset)
        if self.score_type == "nll":
            features_reduced = self.pca_model.transform(dataset)
            self.gaussian_model.fit(features_reduced.T)
Fit PCA and Gaussian model to dataset.

        Args:
            dataset (torch.Tensor): Input dataset with shape
                ``(n_samples, n_features)``.
        
src/anomalib/models/image/dfm/torch_model.py