From 3e3a528a3ea5aff5228169186869aad8ba6e2ef4 Mon Sep 17 00:00:00 2001 From: Vincent Moens Date: Fri, 11 Oct 2024 16:12:24 +0100 Subject: [PATCH] amend --- torchrl/objectives/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torchrl/objectives/utils.py b/torchrl/objectives/utils.py index 94af2d444b7..31954005195 100644 --- a/torchrl/objectives/utils.py +++ b/torchrl/objectives/utils.py @@ -257,6 +257,7 @@ def init_(self) -> None: "to True if it is not done by default. " f"If no target parameter is needed, do not use a target updater such as {type(self)}." ) + # filter the target_ out def filter_target(key): if isinstance(key, tuple): @@ -355,7 +356,7 @@ def __init__( def _step( self, p_source: Tensor | TensorDictBase, p_target: Tensor | TensorDictBase ) -> None: - p_target.data.mul_(self.eps).add_(p_source.data, (1 - self.eps)) + p_target.data.lerp_(p_source.data, 1 - self.eps) class HardUpdate(TargetNetUpdater):