-
Notifications
You must be signed in to change notification settings - Fork 327
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
[Doc] Minor fixes to the docs and type hints #2548
[Doc] Minor fixes to the docs and type hints #2548
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/2548
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -516,7 +516,7 @@ def append_transform( | |||
self, | |||
transform: "Transform" # noqa: F821 | |||
| Callable[[TensorDictBase], TensorDictBase], | |||
) -> None: | |||
) -> EnvBase: |
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.
This should actually return TransformedEnv
.
However, I'm guessing we don't want to import it at the top to prevent loading a lot of modules that won't be accessed?
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.
Either EnvBase
or "torchrl.envs.TransformedEnv" but we can't import it
EnvBase
could be the best compromise!
auto_reset (bool, optional): if ``True``, resets automatically the environment | ||
if it is in a done state when the rollout is initiated. | ||
Default is ``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.
IMO this docstring was wrong and caused some confusion on our side. I hope that I was able to get the correct meaning of this argument.
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.
That looks great!
break_when_any_done (bool): breaks if any of the done state is True. If False, a reset() is | ||
called on the sub-envs that are done. Default is True. | ||
break_when_all_done (bool): TODO |
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.
Took the liberty of adding a docstring here and making some things a bit clearer. Open to suggestions for improvements!
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.
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!
@@ -516,7 +516,7 @@ def append_transform( | |||
self, | |||
transform: "Transform" # noqa: F821 | |||
| Callable[[TensorDictBase], TensorDictBase], | |||
) -> None: | |||
) -> EnvBase: |
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.
Either EnvBase
or "torchrl.envs.TransformedEnv" but we can't import it
EnvBase
could be the best compromise!
auto_reset (bool, optional): if ``True``, resets automatically the environment | ||
if it is in a done state when the rollout is initiated. | ||
Default is ``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.
That looks great!
break_when_any_done (bool): breaks if any of the done state is True. If False, a reset() is | ||
called on the sub-envs that are done. Default is True. | ||
break_when_all_done (bool): TODO |
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.
15e5965
to
5c5ebd0
Compare
5c5ebd0
to
91d2c07
Compare
(cherry picked from commit 50a35f6)
Description
Minor improvements to the documentation and type hints of the environment code.
Types of changes
What types of changes does your code introduce? Remove all that do not apply:
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!