Skip to content

Commit

Permalink
[BugFix] Fix a bug in SliceSampler, indexes outside sampler lengths w…
Browse files Browse the repository at this point in the history
…ere produced (#1874)
  • Loading branch information
vladisai authored Feb 6, 2024
1 parent 528faa1 commit eec9f9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchrl/data/replay_buffers/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ def _get_stop_and_length(self, storage, fallback=True):
raise RuntimeError(
"Could not get a tensordict out of the storage, which is required for SliceSampler to compute the trajectories."
)
vals = self._find_start_stop_traj(end=done.squeeze())[: len(storage)]
vals = self._find_start_stop_traj(end=done.squeeze()[: len(storage)])
if self.cache_values:
self._cache["stop-and-length"] = vals
return vals
Expand Down

0 comments on commit eec9f9e

Please sign in to comment.