Skip to content

Skip bound validation in optimize_acqf if inequality constraints are specified #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 8 additions & 4 deletions botorch/optim/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ def optimize_acqf(
>>> qEI, bounds, 3, 15, 256, sequential=True
>>> )
"""
if not (bounds.ndim == 2 and bounds.shape[0] == 2):
raise ValueError(
f"bounds should be a `2 x d` tensor, current shape: {list(bounds.shape)}."
)
if inequality_constraints is None:
if not (bounds.ndim == 2 and bounds.shape[0] == 2):
raise ValueError(
"bounds should be a `2 x d` tensor, current shape: "
f"{list(bounds.shape)}."
)
# TODO: Validate constraints if provided:
# https://github.com/pytorch/botorch/pull/1231

if sequential and q > 1:
if not return_best_only:
Expand Down