From 1014bf7e82830c0b3ab7c2682ecc10500e42cfbf Mon Sep 17 00:00:00 2001 From: Younggyo Seo Date: Tue, 10 Jun 2025 08:26:27 +0000 Subject: [PATCH] [hotfix] fix issue when using n-step==1 --- fast_td3/fast_td3_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast_td3/fast_td3_utils.py b/fast_td3/fast_td3_utils.py index 6923440..d5c2a1d 100644 --- a/fast_td3/fast_td3_utils.py +++ b/fast_td3/fast_td3_utils.py @@ -388,7 +388,7 @@ class SimpleReplayBuffer(nn.Module): out["critic_observations"] = critic_observations out["next"]["critic_observations"] = next_critic_observations - if self.ptr >= self.buffer_size: + if self.n_steps > 1 and self.ptr >= self.buffer_size: # Roll back the truncation flags introduced for safe sampling self.truncations[:, current_pos - 1] = curr_truncations return out