From d510f28976db2670a6512f83960363636f8df19c Mon Sep 17 00:00:00 2001 From: vmoens Date: Thu, 15 Feb 2024 13:43:04 +0000 Subject: [PATCH] init --- torchrl/objectives/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchrl/objectives/utils.py b/torchrl/objectives/utils.py index b234af6a804..9afbf8095f0 100644 --- a/torchrl/objectives/utils.py +++ b/torchrl/objectives/utils.py @@ -459,7 +459,7 @@ def _cache_values(fun): def new_fun(self, netname=None): __dict__ = self.__dict__ - _cache = __dict__["_cache"] + _cache = __dict__.setdefault("_cache", {}) attr_name = name if netname is not None: attr_name += "_" + netname