Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
vmoens committed Dec 15, 2024
1 parent 1d5484a commit 2813d4b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions torchrl/data/replay_buffers/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def add(self, data: Any) -> int | torch.Tensor:
# Other than that, a "flat" (1d) index is ok to write the data
self._storage.set(_cursor, data)
index = self._replicate_index(index)
for ent in self._storage._attached_entities_iter:
for ent in self._storage._attached_entities_iter():
ent.mark_update(index)
return index

Expand Down Expand Up @@ -302,7 +302,7 @@ def add(self, data: Any) -> int | torch.Tensor:
)
self._storage.set(index, data)
index = self._replicate_index(index)
for ent in self._storage._attached_entities_iter:
for ent in self._storage._attached_entities_iter():
ent.mark_update(index)
return index

Expand Down Expand Up @@ -332,7 +332,7 @@ def extend(self, data: Sequence) -> torch.Tensor:
# Other than that, a "flat" (1d) index is ok to write the data
self._storage.set(index, data)
index = self._replicate_index(index)
for ent in self._storage._attached_entities_iter:
for ent in self._storage._attached_entities_iter():
ent.mark_update(index)
return index

Expand Down Expand Up @@ -533,7 +533,7 @@ def add(self, data: Any) -> int | torch.Tensor:
# Other than that, a "flat" (1d) index is ok to write the data
self._storage.set(index, data)
index = self._replicate_index(index)
for ent in self._storage._attached_entities_iter:
for ent in self._storage._attached_entities_iter():
ent.mark_update(index)
return index

Expand Down Expand Up @@ -567,7 +567,7 @@ def extend(self, data: TensorDictBase) -> None:
device = getattr(self._storage, "device", None)
out_index = torch.full(data.shape, -1, dtype=torch.long, device=device)
index = self._replicate_index(out_index)
for ent in self._storage._attached_entities_iter:
for ent in self._storage._attached_entities_iter():
ent.mark_update(index)
return index

Expand Down

0 comments on commit 2813d4b

Please sign in to comment.