@googlebot haha, thanks for the tips. This is helpful, since I was not sure if that UnsqueezeBackward0 was something that I could trace or not. Seems like the answer is “not”, based on your answer.
I was able to trace through the model and put .clone() on some assignments, which seemed to make the code work now–albeit slower. I probably have more clones than I need, so I can now go through and remove them until the model breaks again. Haha, yeah definitely a cumbersome thing, but not surprising.
Haha, it is funny because from a numerical computing standpoint, we are taught to prefer in-place operations because they are non-allocating and accelerate the code. So it is funny to ignore that instinct.
The odd thing was that all of the examples I saw of this error occurred when a user assigned something to itself, for examples u[i] = 2*u[i-1] or something like that. In my case I did not have anything like that, so the real issue is probably buried somewhere in the lowered code of one of the function calls or such. But at least I know what to do for these kinds of errors now. Thanks again for helping to decipher the message.