From 20037b499a8f00dd820b8e1feddc674e4f84e0c0 Mon Sep 17 00:00:00 2001 From: Vincent Moens Date: Fri, 6 Dec 2024 21:20:19 +0000 Subject: [PATCH] Update [ghstack-poisoned] --- torchrl/envs/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchrl/envs/common.py b/torchrl/envs/common.py index 13d02af2b36..a563f60837d 100644 --- a/torchrl/envs/common.py +++ b/torchrl/envs/common.py @@ -3266,7 +3266,7 @@ def maybe_reset(self, tensordict: TensorDictBase) -> TensorDictBase: """ if self._simple_done: done = tensordict._get_str("done", default=None) - any_done = done.any() + any_done = done is not None and done.any() if any_done: tensordict._set_str( "_reset",