diff --git a/stable_baselines3/common/utils.py b/stable_baselines3/common/utils.py index 9509326595..4eafc0ddef 100644 --- a/stable_baselines3/common/utils.py +++ b/stable_baselines3/common/utils.py @@ -557,9 +557,7 @@ def polyak_update( with th.no_grad(): # zip does not raise an exception if length of parameters does not match. for param, target_param in zip_strict(params, target_params): - target_param.data.mul_(1 - tau) - th.add(target_param.data, param.data, alpha=tau, out=target_param.data) - + target_param.data.lerp_(param.data, tau) def obs_as_tensor(obs: Union[np.ndarray, dict[str, np.ndarray]], device: th.device) -> Union[th.Tensor, TensorDict]: """