Skip to content

Commit

Permalink
[BugFix] load_state_dict in param updates for collectors (#1145)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens authored May 10, 2023
1 parent 9402664 commit a48cd95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchrl/collectors/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def update_policy_weights_(
if policy_weights is not None:
self.policy_weights.apply(lambda x: x.data).update_(policy_weights)
elif self.get_weights_fn is not None:
self.policy.load_state_dict(self.get_weights_fn())
self.policy_weights.apply(lambda x: x.data).update_(self.get_weights_fn())

def __iter__(self) -> Iterator[TensorDictBase]:
return self.iterator()
Expand Down

0 comments on commit a48cd95

Please sign in to comment.