mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-11-18 09:54:10 +00:00
Avoid torch type-error under torch.compile (#1922)
* Avoid torch type-error under torch.compile * Update changelog and version * Update stable_baselines3/common/buffers.py Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org> --------- Co-authored-by: Antonin Raffin <antonin.raffin@ensta.org>
This commit is contained in:
parent
285e01f64a
commit
766b9e9f7d
3 changed files with 3 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ New Features:
|
||||||
|
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
- Cast type in compute gae method to avoid error when using torch compile (@amjames)
|
||||||
|
|
||||||
`SB3-Contrib`_
|
`SB3-Contrib`_
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
|
@ -424,7 +424,7 @@ class RolloutBuffer(BaseBuffer):
|
||||||
last_gae_lam = 0
|
last_gae_lam = 0
|
||||||
for step in reversed(range(self.buffer_size)):
|
for step in reversed(range(self.buffer_size)):
|
||||||
if step == self.buffer_size - 1:
|
if step == self.buffer_size - 1:
|
||||||
next_non_terminal = 1.0 - dones
|
next_non_terminal = 1.0 - dones.astype(np.float32)
|
||||||
next_values = last_values
|
next_values = last_values
|
||||||
else:
|
else:
|
||||||
next_non_terminal = 1.0 - self.episode_starts[step + 1]
|
next_non_terminal = 1.0 - self.episode_starts[step + 1]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
2.3.2
|
2.4.0a0
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue