ai4co / rl4co

A PyTorch library for all things Reinforcement Learning (RL) for Combinatorial Optimization (CO)

Home Page:https://rl4.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Minor] update TensorDicts instead of re-creating

fedebotu opened this issue · comments

As spotted by @cbhua
Same as in TorchRL, reset updates incoming TensorDicts. So under our reset function, we can just call td.update

Reference

Note: this is a minor detail since update can only be done in reset and not step (in step, we need to re-create a TensorDict with the next key thus rendering update useless. We will follow up discussions in #72 !