-
Notifications
You must be signed in to change notification settings - Fork 306
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
[BugFix] SafeModule not safely handling specs #1352
Conversation
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.
LGTM thanks!
Signed-off-by: Matteo Bettini <matbet@meta.com>
torchrl/data/tensor_specs.py
Outdated
try: | ||
self._device = item.device | ||
except RuntimeError: | ||
self._device = item._device |
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 added this because otherwise it would throw an error when trying to clone a CompositeSpec with no device
Signed-off-by: Matteo Bettini <matbet@meta.com>
# Conflicts: # torchrl/modules/tensordict_module/common.py # torchrl/modules/tensordict_module/probabilistic.py
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.
LGTM minor comment
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.
Final
The safe module is very unsafe ;)
Fixes #1278