Skip to content

Commit

Permalink
Add an assertion check on terminals and timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
takuseno committed May 6, 2024
1 parent b734d4e commit c1560bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions d3rlpy/dataset/episode_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def __init__(
assert (
np.sum(np.logical_and(terminals, timeouts)) == 0
), "terminals and timeouts never become True at the same time"
assert (np.sum(terminals) + np.sum(timeouts)) > 0, (
"No episode termination was found. Either terminals"
" or timeouts must include non-zero values."
)

self._observations = observations
self._actions = actions
Expand Down

0 comments on commit c1560bf

Please sign in to comment.