Skip to content

Commit 0a17d6d

Browse files
authored
[BugFix] Fix missing property (#3156)
1 parent a1a9d72 commit 0a17d6d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

torchrl/data/replay_buffers/writers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,14 @@ def extend(self, data: TensorDictBase) -> None:
577577
self._mark_update_entities(index)
578578
return index
579579

580+
# TODO: Workaround for PyTorch nightly regression where compiler can't handle
581+
# method calls on objects returned from _attached_entities_iter()
582+
@torch.compiler.disable()
583+
def _mark_update_entities(self, index: torch.Tensor) -> None:
584+
"""Mark entities as updated with the given index."""
585+
for ent in self._storage._attached_entities_iter():
586+
ent.mark_update(index)
587+
580588
def _empty(self, empty_write_count: bool = True) -> None:
581589
self._cursor = 0
582590
self._current_top_values = []

0 commit comments

Comments
 (0)