From 0e5506ed6756efc8ef4544aed305a488482720e2 Mon Sep 17 00:00:00 2001 From: fan-ziqi Date: Fri, 13 Dec 2024 15:25:43 +0800 Subject: [PATCH] fix: `ObservationBuffer.get_obs_vec()` sorting logic --- src/rl_sar/scripts/observation_buffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rl_sar/scripts/observation_buffer.py b/src/rl_sar/scripts/observation_buffer.py index a1bb7a4..230e728 100755 --- a/src/rl_sar/scripts/observation_buffer.py +++ b/src/rl_sar/scripts/observation_buffer.py @@ -31,7 +31,7 @@ class ObservationBuffer: """ obs = [] - for obs_id in reversed(sorted(obs_ids)): + for obs_id in reversed(obs_ids): slice_idx = self.include_history_steps - obs_id - 1 obs.append(self.obs_buf[:, slice_idx * self.num_obs : (slice_idx + 1) * self.num_obs]) return torch.cat(obs, dim=-1)