Skip to content

Commit

Permalink
removed unreachable block
Browse files Browse the repository at this point in the history
  • Loading branch information
esantorella committed Nov 6, 2022
1 parent efaf058 commit 1a5d04e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions botorch/models/fully_bayesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,15 @@ def load_state_dict(self, state_dict: Mapping[str, Any], strict: bool = True):
# Load the actual samples from the state dict
super().load_state_dict(state_dict=state_dict, strict=strict)

# pyre-ignore[14]: Inconsistent override
# `botorch.models.fully_bayesian.SaasFullyBayesianSingleTaskGP.forward`
# overrides method defined in `gpytorch.module.Module` inconsistently.
# Could not find parameter `Variable(unknown)` in overriding signature.
def forward(self, X: Tensor) -> MultivariateNormal:
"""
Unlike in other classes' `forward` methods, there is no `if self.training`
block, because it ought to be unreachable: If `self.train()` has been called,
then `self.covar_module` will be None, `check_if_fitted()` will fail, and the
rest of this method will not run.
"""
self._check_if_fitted()
x = X.unsqueeze(MCMC_DIM)
if self.training:
x = self.transform_inputs(x)
mean_x = self.mean_module(x)
covar_x = self.covar_module(x)
return MultivariateNormal(mean_x, covar_x)
Expand Down

0 comments on commit 1a5d04e

Please sign in to comment.