Hi,
Before answering your question, in pytorch, the gradients are not automatically reseted to 0 and so you need to do it yourself. Given your code, it should be just before you call loss_train.backward().
I’m confused how the code you have works.
adj is defined as an empty list
It is passed to SecondClass that tries to extract some size information about it. how does that not crash?