Skip to content
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

[Minor] Typo in lazy legacy warnings #639

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tensordict/_torch_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,10 @@ def _stack(
From v0.4 onward, a dense stack will be returned and to build a
lazy stack, an explicit call to LazyStackedTensorDict.lazy_stack will be required.
To silence this warning, choose one of the following options:
- set the LAZY_LEGACY_OP to 'True' (recommended) or 'False' depending on
- set the LAZY_LEGACY_OP environment variable to 'False' (recommended) or 'True' depending on
the behaviour you want to use. Another way to achieve this is to call
`tensordict.set_lazy_legacy(True).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(True)` (recommended) around
`tensordict.set_lazy_legacy(False).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(False)` (recommended) around
the function or code block where stack is used.
- Use `LazyStackedTensorDict.lazy_stack()` if it is a lazy stack that you wish to use.""",
category=DeprecationWarning,
Expand Down
40 changes: 20 additions & 20 deletions tensordict/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,11 @@ def unsqueeze(self, *args, **kwargs):
version of the unsqueezed tensordict. Up until v0.3 included, a lazy unsqueezed tensordict was returned.
From v0.4 onward, a dense unsqueeze will be returned.
To silence this warning, choose one of the following options:
- set the LAZY_LEGACY_OP to 'True' (recommended) or 'False' depending on
- set the LAZY_LEGACY_OP environment variable to 'False' (recommended) or 'True' depending on
the behaviour you want to use. Another way to achieve this is to call
`tensordict.set_lazy_legacy(True).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(True)` (recommended) around
the function or code block where stack is used.
`tensordict.set_lazy_legacy(False).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(False)` (recommended) around
the function or code block where unsqueeze is used.

To temporarily unsqueeze a tensordict you can still user unsqueeze() as a context manager (see docstrings).
""",
Expand Down Expand Up @@ -771,11 +771,11 @@ def squeeze(self, *args, **kwargs):
version of the squeezed tensordict. Up until v0.3 included, a lazy squeezed tensordict was returned.
From v0.4 onward, a dense squeeze will be returned.
To silence this warning, choose one of the following options:
- set the LAZY_LEGACY_OP to 'True' (recommended) or 'False' depending on
- set the LAZY_LEGACY_OP environment variable to 'False' (recommended) or 'True' depending on
the behaviour you want to use. Another way to achieve this is to call
`tensordict.set_lazy_legacy(True).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(True)` (recommended) around
the function or code block where stack is used.
`tensordict.set_lazy_legacy(False).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(False)` (recommended) around
the function or code block where squeeze is used.

To temporarily squeeze a tensordict you can still user squeeze() as a context manager (see docstrings).
""",
Expand Down Expand Up @@ -983,11 +983,11 @@ def view(
version of the viewed tensordict. Up until v0.3 included, a lazy view of the tensordict was returned.
From v0.4 onward, a proper view will be returned.
To silence this warning, choose one of the following options:
- set the LAZY_LEGACY_OP to 'True' (recommended) or 'False' depending on
- set the LAZY_LEGACY_OP environment variable to 'False' (recommended) or 'True' depending on
the behaviour you want to use. Another way to achieve this is to call
`tensordict.set_lazy_legacy(True).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(True)` (recommended) around
the function or code block where stack is used.
`tensordict.set_lazy_legacy(False).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(False)` (recommended) around
the function or code block where view is used.

To temporarily view a tensordict you can still user view() as a context manager (see docstrings).
""",
Expand Down Expand Up @@ -1052,11 +1052,11 @@ def transpose(self, dim0, dim1):
version of the transposed tensordict. Up until v0.3 included, a lazy transpose of the tensordict was returned.
From v0.4 onward, a proper transpose will be returned.
To silence this warning, choose one of the following options:
- set the LAZY_LEGACY_OP to 'True' (recommended) or 'False' depending on
- set the LAZY_LEGACY_OP environment variable to 'False' (recommended) or 'True' depending on
the behaviour you want to use. Another way to achieve this is to call
`tensordict.set_lazy_legacy(True).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(True)` (recommended) around
the function or code block where stack is used.
`tensordict.set_lazy_legacy(False).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(False)` (recommended) around
the function or code block where transpose is used.

To temporarily transpose a tensordict you can still user transpose() as a context manager (see docstrings).
""",
Expand Down Expand Up @@ -1167,11 +1167,11 @@ def permute(self, *args, **kwargs):
version of the permuted tensordict. Up until v0.3 included, a lazy permute of the tensordict was returned.
From v0.4 onward, a proper permute will be returned.
To silence this warning, choose one of the following options:
- set the LAZY_LEGACY_OP to 'True' (recommended) or 'False' depending on
- set the LAZY_LEGACY_OP environment variable to 'False' (recommended) or 'True' depending on
the behaviour you want to use. Another way to achieve this is to call
`tensordict.set_lazy_legacy(True).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(True)` (recommended) around
the function or code block where stack is used.
`tensordict.set_lazy_legacy(False).set()` at the beginning of your script.
- set the decorator/context manager `tensordict.set_lazy_legacy(False)` (recommended) around
the function or code block where permute is used.

To temporarily permute a tensordict you can still user permute() as a context manager (see docstrings).
""",
Expand Down
Loading