Skip to content

Commit

Permalink
Turn guard clause into if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Apr 26, 2024
1 parent a88a5c1 commit f4d500b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions baybe/surrogates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ def _fit_new(
if train_y.numel() == 1 or train_y.std() < std_threshold:
self._model = MeanPredictionSurrogate()
self._model._fit(searchspace, train_x, train_y)
return

# Regular operation
_fit_original(self, searchspace, train_x, train_y)
else:
_fit_original(self, searchspace, train_x, train_y)

# Replace the methods
cls._posterior = _posterior_new
Expand Down

0 comments on commit f4d500b

Please sign in to comment.