From 49ab3a9075b5ea6ed8481af96da8b6c0233dfcda Mon Sep 17 00:00:00 2001 From: Jonathanace Date: Sat, 6 Apr 2024 22:54:26 -0700 Subject: [PATCH] fix a critical bug in the example in the documentation for the ActionMask transform --- torchrl/envs/transforms/transforms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchrl/envs/transforms/transforms.py b/torchrl/envs/transforms/transforms.py index 14a8e9e1a02..e25ed08ebed 100644 --- a/torchrl/envs/transforms/transforms.py +++ b/torchrl/envs/transforms/transforms.py @@ -6676,7 +6676,7 @@ class ActionMask(Transform): ... self.observation_spec = CompositeSpec(obs=UnboundedContinuousTensorSpec(3)) ... self.reward_spec = UnboundedContinuousTensorSpec(1) ... - ... def _reset(self, data): + ... def _reset(self, tensordict=None): ... td = self.observation_spec.rand() ... td.update(torch.ones_like(self.state_spec.rand())) ... return td