From 1a5d04e4b4c096d026cf785da86a81c255ee426e Mon Sep 17 00:00:00 2001 From: Elizabeth Santorella Date: Sun, 6 Nov 2022 13:08:03 -0500 Subject: [PATCH] removed unreachable block --- botorch/models/fully_bayesian.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/botorch/models/fully_bayesian.py b/botorch/models/fully_bayesian.py index 4045462c28..15823c0414 100644 --- a/botorch/models/fully_bayesian.py +++ b/botorch/models/fully_bayesian.py @@ -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)