You could call backward on out3 (or the mean/sum of it) and see if all parameters you care about have valid .grad attributes. Since .grad will be None after initialization, this should give you some feedback on the proper gradient calculation.