Hi,
We do quite a lot of changes between releases and you can check the release notes for any breaking change we make.
When you say “complex loss” you mean that in the sense that it is complicated or uses complex numbers? If it’s the second, we started working on autograd support for complex numbers. So you might get derivatives for things that used not to have some. You might need some extra .detach() to avoid any issue there.
Otherwise, the error comes from the fact that you’re calling backward on some part of the graph twice. Most likely because you share part of the graph between iterations. You might want to check that you don’t do any operation on Tensors that require gradients outside of the inner training loop.
Otherwise, we would need a code sample to give you more guidance