Skip to content

Commit

Permalink
amend
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Mar 19, 2024
1 parent db63217 commit 7de1582
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/agents/multi-step.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
The core component of this example is the `MultiStepActorWrapper` class.
`MultiStepActorWrapper` handles the calls to the actor when the macro has run out of actions or
when the environment has been reset (which is indicated by the InitTracker transform).
"""

import torch.nn
Expand All @@ -22,13 +25,14 @@
SerialEnv,
TransformedEnv,
)
from torchrl.modules.tensordict_module.actors import Actor, MultiStepActorWrapper
from torchrl.modules.tensordict_module.actors import MultiStepActorWrapper

time_steps = 6
n_obs = 4
n_action = 2
batch = 5


# Transforms a CatFrames in a stack of frames
def reshape_cat(data: torch.Tensor):
return data.unflatten(-1, (time_steps, n_obs))
Expand Down

0 comments on commit 7de1582

Please sign in to comment.