Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion qpytorch/distributions/multivariate_qexponential.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,12 @@ def log_prob(self, value: Tensor) -> Tensor:
See :py:meth:`torch.distributions.Distribution.log_prob
<torch.distributions.distribution.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:
Expand Down