Skip to content

Commit a7f24f6

Browse files
[BugFIx] Changed "set_count" set in collectors (#835)
1 parent f92edc7 commit a7f24f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,4 +550,3 @@ The features are available before an official release so that users and collabor
550550

551551
# License
552552
TorchRL is licensed under the MIT License. See [LICENSE](LICENSE) for details.
553-

torchrl/collectors/collectors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from tensordict.tensordict import TensorDict, TensorDictBase
2323
from torch import multiprocessing as mp
2424
from torch.utils.data import IterableDataset
25+
2526
from torchrl._utils import _check_for_faulty_process, prod
2627
from torchrl.collectors.utils import split_trajectories
2728
from torchrl.data import TensorSpec
@@ -655,7 +656,7 @@ def rollout(self) -> TensorDictBase:
655656
self._tensordict = self.env.step(self._tensordict)
656657

657658
step_count = self._tensordict.get("step_count")
658-
step_count += 1
659+
self._tensordict.set_("step_count", step_count + 1)
659660
# we must clone all the values, since the step / traj_id updates are done in-place
660661
try:
661662
self._tensordict_out[..., j] = self._tensordict

0 commit comments

Comments
 (0)