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

[Feature] Nested keys in OrnsteinUhlenbeckProcess #1305

Merged
merged 22 commits into from
Jul 6, 2023
Merged
Prev Previous commit
Next Next commit
amend
Signed-off-by: Matteo Bettini <matbet@meta.com>
  • Loading branch information
matteobettini committed Jul 6, 2023
commit 15e6036adda0fca86c97fb53635e54007e18ac78
2 changes: 1 addition & 1 deletion torchrl/modules/tensordict_module/exploration.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def add_sample(

# Get the nested tensordict where the action lives
if isinstance(self.key, tuple) and len(self.key) > 1:
action_tensordict = tensordict.get(self.key[-1])
action_tensordict = tensordict.get(self.key[:-1])
else:
action_tensordict = tensordict

Expand Down