Skip to content

Commit 534851b

Browse files
Abbas Kazerounifacebook-github-bot
authored andcommitted
fixing device mismatch in botorch optim stopping
Summary: This fixes a device mismatch problem in botorch optimization stopping procedure. It makes sure that "weights " and "fvals" are tensors with the same device type. Reviewed By: Balandat Differential Revision: D20480298 fbshipit-source-id: 6932de24afc8e6a3a67ae0175f34990fd8e1d0d2
1 parent 997a33e commit 534851b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

botorch/optim/stopping.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def evaluate(self, fvals: Tensor) -> bool:
107107
return False
108108

109109
weights = self.weights
110+
weights = weights.to(fvals)
110111
if self._prev_fvals.ndim > 1:
111112
weights = weights.unsqueeze(-1)
112113

0 commit comments

Comments
 (0)