Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
vmoens committed Nov 25, 2024
1 parent 924e062 commit a89eff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchrl/objectives/sac.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ def _compute_target(self, tensordict) -> Tensor:
# unlike in continuous SAC, we can compute the exact expectation over all discrete actions
next_state_value = (next_prob * next_state_value).sum(-1).unsqueeze(-1)
if next_tensordict_select is not next_tensordict:
mask = ~done.squeeze(-1)
mask = ~done
next_state_value = next_state_value.new_zeros(
mask.shape
).masked_scatter_(mask, next_state_value)
Expand Down

0 comments on commit a89eff9

Please sign in to comment.