Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 601698f

Browse filesBrowse files
committed
fix the RSSMRollout bug
1 parent 8570c25 commit 601698f
Copy full SHA for 601698f

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Open diff view settings
Collapse file

‎torchrl/modules/models/model_based.py‎

Copy file name to clipboardExpand all lines: torchrl/modules/models/model_based.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# from torchrl.modules.tensordict_module.rnn import GRUCell
2020
from torch.nn import GRUCell
2121
from torchrl._utils import timeit
22+
from torchrl.envs.utils import step_mdp
2223

2324
from torchrl.modules.models.models import MLP
2425

@@ -261,6 +262,8 @@ def forward(self, tensordict):
261262

262263
tensordict_out.append(_tensordict)
263264
if t < time_steps - 1:
265+
# Translate ("next", *) to the non-next key required for the current step input
266+
_tensordict = step_mdp(_tensordict, keep_other=True)
264267
_tensordict = _tensordict.select(*self.in_keys, strict=False)
265268
_tensordict = update_values[t + 1].update(_tensordict)
266269

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.