Skip to content

Commit e0c4ae9

Browse files
author
Vincent Moens
committed
[Performance] Avoid cloning trajs in SliceSampler
ghstack-source-id: ac4a85a Pull Request resolved: #2671
1 parent f1dabad commit e0c4ae9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrl/data/replay_buffers/samplers.py

Lines changed: 1 addition & 1 deletion
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)