Skip to content

Commit

Permalink
Fixed e2e test, added sorted list
Browse files Browse the repository at this point in the history
  • Loading branch information
hakuryuu96 committed Oct 27, 2023
1 parent 3674958 commit 31aaa38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/end_to_end_tests/trainer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_checkpoint_content(self):
ckpt_paths = [os.path.join(trainer.checkpoints_dir_path, suf) for suf in ckpt_filename]
for ckpt_path in ckpt_paths:
ckpt = torch.load(ckpt_path)
self.assertListEqual(["net", "acc", "epoch", "optimizer_state_dict", "scaler_state_dict", "packages"], list(ckpt.keys()))
self.assertListEqual(sorted(["net", "acc", "epoch", "optimizer_state_dict", "scaler_state_dict", "packages"]), sorted(list(ckpt.keys())))
trainer._save_checkpoint()
weights_only = torch.load(os.path.join(trainer.checkpoints_dir_path, "ckpt_latest_weights_only.pth"))
self.assertListEqual(["net"], list(weights_only.keys()))
Expand Down

0 comments on commit 31aaa38

Please sign in to comment.