Skip to content

Commit

Permalink
[BugFix] done = done | truncated in collector (#2333)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Jul 29, 2024
1 parent 0063741 commit cdcd9f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion torchrl/collectors/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,10 @@ def _maybe_set_truncated(self, final_rollout):
truncated = final_rollout["next", truncated_key]
truncated[last_step] = True
final_rollout["next", truncated_key] = truncated
final_rollout["next", _replace_last(truncated_key, "done")] = truncated
done = final_rollout["next", _replace_last(truncated_key, "done")]
final_rollout["next", _replace_last(truncated_key, "done")] = (
done | truncated
)
return final_rollout

@torch.no_grad()
Expand Down

0 comments on commit cdcd9f3

Please sign in to comment.