Skip to content

Commit f61078d

Browse files
author
Vincent Moens
committed
[BugFix] Remove to(device) for clip_value usage as it's a buffer already
ghstack-source-id: ec50cf8 Pull-Request-resolved: #2960
1 parent 60d8b1a commit f61078d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrl/objectives/ppo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ def loss_critic(self, tensordict: TensorDictBase) -> torch.Tensor:
677677
loss_value, clip_fraction = _clip_value_loss(
678678
old_state_value,
679679
state_value,
680-
self.clip_value.to(state_value.device),
680+
self.clip_value,
681681
target_return,
682682
loss_value,
683683
self.loss_critic_type,

0 commit comments

Comments
 (0)