Actually Y1 is the output of my network and X1 is ground truth. So during training I am calculating this loss by calling this function and then when I am calling loss.backward() and trying to print gradients of parameters of my network then all the gradients are None. So I couldn’t find where the problem is?