diff --git a/open_spiel/python/pytorch/dqn.py b/open_spiel/python/pytorch/dqn.py index 0bb2bb6657..d4c68d55cd 100644 --- a/open_spiel/python/pytorch/dqn.py +++ b/open_spiel/python/pytorch/dqn.py @@ -396,9 +396,9 @@ def copy_with_noise(self, sigma=0.0, copy_weights=True): if copy_weights: with torch.no_grad(): for q_model in q_network.model: - q_model.weight *= (1 + sigma * torch.randn(q_model.weight.shape)) + q_model._weight *= (1 + sigma * torch.randn(q_model._weight.shape)) for tq_model in target_q_network.model: - tq_model.weight *= (1 + sigma * torch.randn(tq_model.weight.shape)) + tq_model._weight *= (1 + sigma * torch.randn(tq_model._weight.shape)) return copied_object def save(self, data_path, optimizer_data_path=None):