i get the same error too, I simplify my net to one Linear, and remove the activation function, and this error disappeared, but I got another error:Function ‘AddmmBackward’ returned nan values in its 1th output.