Skip to content

Commit c83d80a

Browse files
authored
[Doc] Fix locked samples from RBs and ccl of tuto (#1132)
1 parent c671e85 commit c83d80a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

torchrl/data/replay_buffers/storages.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def get(self, index: Union[int, Sequence[int], slice]) -> Any:
276276
out = self._storage[index]
277277
if is_tensor_collection(out):
278278
out = _reset_batch_size(out)
279-
return out
279+
return out.unlock_()
280280

281281
def __len__(self):
282282
return self._len

tutorials/sphinx-tutorials/rb_tutorial.py

+8
Original file line numberDiff line numberDiff line change
@@ -680,4 +680,12 @@ class MyData:
680680
# Conclusion
681681
# ----------
682682
#
683+
# We have seen how a replay buffer can be used in TorchRL, from its simplest
684+
# usage to more advanced ones where the data need to be transformed or stored
685+
# in particular ways.
686+
# You should now be able to:
687+
#
688+
# - Create a Replay Buffer, customize its storage, sampler and transforms;
689+
# - Choose the best storage type for your problem (list, memory or disk-based);
690+
# - Minimize the memory footprint of your buffer.
683691
#

0 commit comments

Comments
 (0)