Skip to content

Commit 21b9307

Browse files
Balandatmeta-codesync[bot]
authored andcommitted
Update return type annotation to match botorch API change (facebook#5014)
Summary: Pull Request resolved: facebook#5014 Update the return type annotation of `minimal_mixed_optimizer` wrapper function to `tuple[Tensor, Tensor | None]` to match the updated return type of `optimize_acqf_mixed_alternating` from botorch. The upstream botorch function signature changed in D96154880 to return `tuple[Tensor, Tensor | None]` instead of `tuple[Tensor, Tensor]`, which caused the type-checking test to fail. Reviewed By: hvarfner Differential Revision: D96186306 fbshipit-source-id: b8c66ab8f884c892d9f19032c1f4f766e0c6d5a2
1 parent 70f9046 commit 21b9307

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ax/utils/testing/mock.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def mock_botorch_optimize_context_manager(
5151
def minimal_fit_fully_bayesian(*args: Any, **kwargs: Any) -> None:
5252
fit_fully_bayesian_model_nuts(*args, **_get_minimal_mcmc_kwargs(**kwargs))
5353

54-
def minimal_mixed_optimizer(*args: Any, **kwargs: Any) -> tuple[Tensor, Tensor]:
54+
def minimal_mixed_optimizer(
55+
*args: Any, **kwargs: Any
56+
) -> tuple[Tensor, Tensor | None]:
5557
# BoTorch's `mock_optimize_context_manager` also has some mocks for this,
5658
# but the full set of mocks applied here cannot be covered by that.
5759
kwargs["raw_samples"] = 2

0 commit comments

Comments
 (0)