Skip to content

Commit

Permalink
amend
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Apr 18, 2024
1 parent 7c7d4ce commit 5152b9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torchrl/objectives/value/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,9 @@ def reward2go(
cumsum = _inv_pad_sequence(cumsum, num_per_traj)
cumsum = cumsum.reshape_as(reward)
cumsum = cumsum.transpose(-2, -1)
# if cumsum.shape != shape:
if cumsum.shape != shape:
raise RuntimeError(
f"Wrong shape for output reward2go: {cumsum.shape} when {shape} was expected."
)
# cumsum = cumsum.view(shape)
return cumsum

0 comments on commit 5152b9d

Please sign in to comment.