diff --git a/ax/utils/testing/mock.py b/ax/utils/testing/mock.py index 905ec88cb5a..0593143518a 100644 --- a/ax/utils/testing/mock.py +++ b/ax/utils/testing/mock.py @@ -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: diff --git a/tutorials/modular_botorch/modular_botorch.ipynb b/tutorials/modular_botorch/modular_botorch.ipynb index aeb05f8d335..50a024955c4 100644 --- a/tutorials/modular_botorch/modular_botorch.ipynb +++ b/tutorials/modular_botorch/modular_botorch.ipynb @@ -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",