Inplace Operations when using Pyrfm

Hi Huzaifa!

The likely immediate cause of your inplace-modification error is your use of
retain_graph = True. Try removing it.

Note that optimizer.step() counts as an inplace operation, so you normally
don’t want the “retained graph” still around when you call it.

If you think that you actually do need retain_graph = True, make sure you
that you understand why so that you can either avoid it or arrange things to
avoid the inplace-modification error.

I don’t really understand what your code is doing – you can find some suggestions
for debugging inplace-modification errors in this post:

Good luck!

K. Frank