Skip to content

Commit 4fd54fe

Browse files
committed
[Performance] Avoid cloning trajs in SliceSampler
ghstack-source-id: 2e133fc Pull Request resolved: #2671
1 parent 21eeca4 commit 4fd54fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrl/data/replay_buffers/samplers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ def _get_stop_and_length(self, storage, fallback=True):
12431243
"Could not get a tensordict out of the storage, which is required for SliceSampler to compute the trajectories."
12441244
)
12451245
vals = self._find_start_stop_traj(
1246-
trajectory=trajectory.clone(),
1246+
trajectory=trajectory,
12471247
at_capacity=storage._is_full,
12481248
cursor=getattr(storage, "_last_cursor", None),
12491249
)

0 commit comments

Comments
 (0)