diff --git a/qpytorch/distributions/multivariate_qexponential.py b/qpytorch/distributions/multivariate_qexponential.py index 5cd1ab8..6a55153 100644 --- a/qpytorch/distributions/multivariate_qexponential.py +++ b/qpytorch/distributions/multivariate_qexponential.py @@ -241,7 +241,12 @@ def log_prob(self, value: Tensor) -> Tensor: See :py:meth:`torch.distributions.Distribution.log_prob `. """ - if settings.fast_computations.log_prob.off(): + # The torch.distributions.MultivariateNormal fallback is Gaussian-only. + # Only use it when power == 2. When fast_computations.log_prob is off + # (e.g. BoTorch disables it on import; QePyTorch shares gpytorch.settings), + # falling back for power != 2 silently ignores `power` and returns the + # Gaussian log-density. + if settings.fast_computations.log_prob.off() and bool(torch.as_tensor(self.power == 2).all()): return super().log_prob(value) if self._validate_args: