[BUG] Collector deletes new tensordict keys
Open
@vmoens is already working on this.
Since Oct 10, 2023.
bug
- Dominant language
- Python
- Stars
- 3.6k
- Forks
- 487
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 207
Description
New Tensordict keys created in policy modules used in the collector are not returned in the rollout tensordict.
The issue is in this line, as setting "out" for torch.stack deletes any new entries which have been created:
https://github.com/pytorch/rl/blob/70c650ec8c946f36fd8d57c11612548da2251128/torchrl/collectors/collectors.py#L877
I did find a workaround, which is to use TensorDictPrimer to create a TransformedEnv that has the new keys that you wish to be saved.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.