Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion ax/utils/testing/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def skip_fit_gpytorch_mll_context_manager() -> Generator[None, None, None]:
This should only be used to speed up slow tests.
"""
with mock.patch(
"botorch.fit.FitGPyTorchMLL", side_effect=lambda *args, **kwargs: args[0]
"ax.generators.torch.botorch_modular.utils.fit_gpytorch_mll",
side_effect=lambda mll, **kwargs: mll.eval(),
) as mock_fit:
yield
if mock_fit.call_count < 1:
Expand Down
5 changes: 3 additions & 2 deletions tutorials/modular_botorch/modular_botorch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,10 @@
"metadata": {},
"outputs": [],
"source": [
"from botorch.fit import fit_gpytorch_mll\n",
"from gpytorch.mlls.marginal_log_likelihood import MarginalLogLikelihood\n",
"from ax.generators.torch.botorch_modular.utils import fit_botorch_model\n",
"from ax.generators.torch.botorch_modular.utils import (\n",
" fit_botorch_model, fit_gpytorch_mll\n",
")\n",
"\n",
"@fit_botorch_model.register(SimpleCustomGP)\n",
"def _fit_botorch_model_test(\n",
Expand Down
Loading