# Inplace operation errors when implementing A2C algorithm

**URL:** <https://discuss.pytorch.org/t/inplace-operation-errors-when-implementing-a2c-algorithm/145406>\
**Category:** reinforcement-learning\
**Created:** [March 2, 2022, 2:59pm UTC](https://discuss.pytorch.org/t/inplace-operation-errors-when-implementing-a2c-algorithm/145406 "2022-03-02T14:59:42Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![fahmyadan](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/fahmyadan/32/55168_2.png) [@fahmyadan](https://discuss.pytorch.org/u/fahmyadan)\
**Post date:** [February 15, 2023, 12:25pm UTC](https://discuss.pytorch.org/t/inplace-operation-errors-when-implementing-a2c-algorithm/145406/6 "2023-02-15T12:25:09Z")

</div>

Hello @DungNguyen

It appears as if I’m facing the exact same problem as you, implementing multiple A2C agents in a RL gym env. I have encountered the same errors and I suspect your solution might be helpful for my use case.

Can you explain what `worker.data` represents conceptually and how you went about resetting it after every episode?

Thanks in advance 🙂

---

_[View the full topic](https://discuss.pytorch.org/t/inplace-operation-errors-when-implementing-a2c-algorithm/145406)._
