Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
BowenD-UCB committed Mar 1, 2024
1 parent 3bc34b5 commit 2fb442d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ def test_trainer_composition_model(tmp_path: Path) -> None:
new_chgnet = CHGNet.from_file(weights_path)
for param in new_chgnet.composition_model.parameters():
assert param.requires_grad is False
comparison = (
new_chgnet.composition_model.state_dict()["fc.weight"] == initial_weights
)
comparison = new_chgnet.composition_model.state_dict()["fc.weight"].to(
"cpu"
) == initial_weights.to("cpu")
expect = torch.ones_like(comparison)
# Only Na and Cl should have updated
expect[0][10] = 0
Expand Down

0 comments on commit 2fb442d

Please sign in to comment.