Alkane0050:

I think i haven’t do some inplace operation.


Inplace operations use this syntax: a += b where the actual operation could also be changed to a subtraction, multiplication, etc.
In your code you are using it e.g. here:
stats.episode_rewards[i_episode] += reward

which could cause the issue.
I would recommend to replace these inplace ops with their out-of-place versions.