U have to return a FloatTensor that is the result of some operation of ur loss function, so ur loss function won’t break the gradients graph. To be more specific, can u provide an example code of ur loss function?