diff --git a/botorch/optim/optimize.py b/botorch/optim/optimize.py index f071239dbe..6caf37904d 100644 --- a/botorch/optim/optimize.py +++ b/botorch/optim/optimize.py @@ -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: