HumanCompatibleAI / imitation

Clean PyTorch implementations of imitation and reward learning algorithms
https://imitation.readthedocs.io/
MIT License
1.33k stars 248 forks source link

Ensure safe_to_tensor moves tensors to the specified device. #831

Open ernestum opened 11 months ago

ernestum commented 11 months ago

This PR fixes a bug in the safe_to_tensor utility: previously it did not move tensors to a new device according to the device kwarg which caused issues when there is more than one device available. The bug went unnoticed for a long while since our circleCI runners do not have GPUs enabled.

Thanks to @tomtseng for drafting a fix for this in #828

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (a8b079c) 95.69% compared to head (7e618b0) 95.71%.

:exclamation: Current head 7e618b0 differs from pull request most recent head 2cfd7f1. Consider uploading reports for the commit 2cfd7f1 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #831 +/- ## ========================================== + Coverage 95.69% 95.71% +0.02% ========================================== Files 102 102 Lines 9645 9646 +1 ========================================== + Hits 9230 9233 +3 + Misses 415 413 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ernestum commented 10 months ago

I think the coverage warning in this one is spurious. Can you merge this @AdamGleave ?

AdamGleave commented 9 months ago

I think the coverage warning in this one is spurious. Can you merge this @AdamGleave ?

Looks like the issue is that test_sqil_performance_continuous is being skipped. This is going to continue to cause a problem in all subsequent PRs requiring manual override -- we try and enforce 100% test coverage to make sure nothing is being unintentionally not run. I think you can just add a # pragma: no cover to fix this. If that doesn't work LMK and I can try to troubleshoot.

dominikonysz commented 6 months ago

Hello, what's the state of this PR?