Skip to content

Commit

Permalink
Update stable_baselines3/common/buffers.py
Browse files Browse the repository at this point in the history
Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org>
  • Loading branch information
amjames and araffin authored May 13, 2024
1 parent 95ccf80 commit 4ef5c76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stable_baselines3/common/buffers.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def compute_returns_and_advantage(self, last_values: th.Tensor, dones: np.ndarra
last_gae_lam = 0
for step in reversed(range(self.buffer_size)):
if step == self.buffer_size - 1:
next_non_terminal = 1.0 - dones.astype(int)
next_non_terminal = 1.0 - dones.astype(np.float32)
next_values = last_values
else:
next_non_terminal = 1.0 - self.episode_starts[step + 1]
Expand Down

0 comments on commit 4ef5c76

Please sign in to comment.