Skip to content

Commit b91050c

Browse files
committed
Update comments
1 parent 12d538f commit b91050c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stable_baselines3/common/buffers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,9 +854,8 @@ def _get_samples(self, batch_inds: np.ndarray, env: Optional[VecNormalize] = Non
854854

855855
# Compute n-step indices with wrap-around
856856
steps = np.arange(n_steps).reshape(1, -1) # shape: [1, n_steps]
857-
# Note: the self.pos index is invalid (will overlap two different episodes when buffer is full)
858-
# 1. We do not sample self.pos
859-
# 2. We set self.pos-1 to truncated=True (temporarly) if done=False
857+
# Note: the self.pos index is dangerous (will overlap two different episodes when buffer is full)
858+
# so we set self.pos-1 to truncated=True (temporarly) if done=False
860859
safe_timeouts = self.timeouts.copy()
861860
safe_timeouts[self.pos - 1, :] = np.logical_not(self.dones[self.pos - 1, :])
862861

0 commit comments

Comments
 (0)