def _e_step(self, data: torch.Tensor) -> torch.Tensor:
        """Perform E-step to compute responsibilities and log-likelihood.

        Args:
            data (torch.Tensor): Input data.
                Shape: ``(n_samples, n_features)``.

        Returns:
            tuple[torch.Tensor, torch.Tensor]: Tuple containing:
                - Mean log-likelihood of the data
                - Responsibilities for each component.
                  Shape: ``(n_samples, n_components)``
        """
        weighted_log_prob = self._estimate_weighted_log_prob(data)
        log_prob_norm = torch.logsumexp(weighted_log_prob, axis=1)
        log_resp = weighted_log_prob - torch.logsumexp(
            weighted_log_prob,
            dim=1,
            keepdim=True,
        )
        return torch.mean(log_prob_norm), torch.exp(log_resp)
Perform E-step to compute responsibilities and log-likelihood.

        Args:
            data (torch.Tensor): Input data.
                Shape: ``(n_samples, n_features)``.

        Returns:
            tuple[torch.Tensor, torch.Tensor]: Tuple containing:
                - Mean log-likelihood of the data
                - Responsibilities for each component.
                  Shape: ``(n_samples, n_components)``
        
src/anomalib/models/components/cluster/gmm.py