Skip to content

Commit

Permalink
[QOL] throw assertion error if env was already done
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebotu committed Nov 8, 2023
1 parent 7de5787 commit c5cebc2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rl4co/models/zoo/common/autoregressive/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def forward(
outputs.append(log_p)
actions.append(action)

assert len(outputs) > 0, "No outputs were collected because all environments were done. Check your initial state"
outputs, actions = torch.stack(outputs, 1), torch.stack(actions, 1)
if calc_reward:
td.set("reward", env.get_reward(td, actions))
Expand Down

0 comments on commit c5cebc2

Please sign in to comment.