Well that errors means that you’re modifying inplace something you should not.
If you don’t use no_grad at all, then this means that you’re modifying an input inplace which is not allowed. You should add a clone before that op or make that op not inplace to solve that issue.