-
Notifications
You must be signed in to change notification settings - Fork 373
[BugFix] Fix SyncDataCollector reset #571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fix SyncDataCollector reset
Codecov Report
@@ Coverage Diff @@
## main #571 +/- ##
=======================================
Coverage 86.90% 86.90%
=======================================
Files 121 121
Lines 21802 21802
=======================================
+ Hits 18946 18947 +1
+ Misses 2856 2855 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Let's try without the update?
torchrl/collectors/collectors.py
Outdated
@@ -585,7 +585,7 @@ def _reset_if_necessary(self) -> None: | |||
else: | |||
self._tensordict.zero_() | |||
|
|||
self._tensordict.update(self.env.reset(), inplace=True) | |||
self._tensordict.update(self.env.reset(self._tensordict), inplace=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need the call to update.
env.reset() will update the tensordict.
I implemented some tests, let me know if they make sense |
Thanks! It seems like the step counts are also incorrect, so I think only assertions 313 and 322 are really necessary. |
Do you mean "were incorrect" or are they still incorrect after this PR? |
Sorry, they were incorrect |
Description
Fix #570
close #570
Types of changes
Checklist