Skip to content

Commit

Permalink
fix: mixed optimization tests break when using dim 3 batch initial co…
Browse files Browse the repository at this point in the history
…nditions
  • Loading branch information
CompRhys committed Nov 5, 2024
1 parent 537fc68 commit b5b7fe5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 0 additions & 8 deletions botorch/optim/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,6 @@ def __post_init__(self) -> None:
"3-dimensional. Its shape is "
f"{batch_initial_conditions_shape}."
)
# make dim 2 inputs into dim 3 inputs in order to be consistent downstream.
if len(batch_initial_conditions_shape) == 2:
# Use object.__setattr__ to bypass immutability and set a value
object.__setattr__(
self,
"batch_initial_conditions",
self.batch_initial_conditions.unsqueeze(0),
)

if batch_initial_conditions_shape[-1] != d:
raise ValueError(
Expand Down
1 change: 1 addition & 0 deletions botorch/optim/optimize_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ def continuous_step(
updated_opt_inputs = dataclasses.replace(
opt_inputs,
q=1,
raw_samples=None,
num_restarts=1,
batch_initial_conditions=current_x.unsqueeze(0),
fixed_features={
Expand Down

0 comments on commit b5b7fe5

Please sign in to comment.