Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
roussel-ryan committed Nov 22, 2024
1 parent e7f7939 commit 89ae202
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion xopt/generators/bayesian/models/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ def build_model(

# if specified, use cached model hyperparameters
if self.use_cached_hyperparameters:
store = {name: ele.to(**tkwargs) for name, ele in self._hyperparameter_store.items()}
store = {
name: ele.to(**tkwargs)
for name, ele in self._hyperparameter_store.items()
}
full_model.load_state_dict(store)

# cache model hyperparameters
Expand Down
4 changes: 3 additions & 1 deletion xopt/tests/generators/bayesian/test_model_constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ def compare_dicts_with_tensors(dict1, dict2):
return True

new_model = constructor.build_model_from_vocs(test_vocs, test_data)
assert compare_dicts_with_tensors(new_model.state_dict(), old_model.state_dict())
assert compare_dicts_with_tensors(
new_model.state_dict(), old_model.state_dict()
)

# test error handling - should raise a warning that hyperparameters were not
# used
Expand Down

0 comments on commit 89ae202

Please sign in to comment.