Add regression tests (#119)

- Add `tests/scripts/save_policy_to_safetensor.py` to generate test artifacts
- Add `test_backward_compatibility to test generated outputs from the policies against artifacts
This commit is contained in:
Simon Alibert
2024-05-04 16:20:30 +02:00
committed by GitHub
parent 19812ca470
commit c77633c38c
15 changed files with 236 additions and 43 deletions

View File

@@ -265,7 +265,7 @@ def test_backward_compatibility(repo_id):
for key in new_frame:
assert torch.isclose(
new_frame[key], old_frame[key], rtol=1e-05, atol=1e-08
new_frame[key], old_frame[key]
).all(), f"{key=} for index={i} does not contain the same value"
# test2 first frames of first episode