I am sorry I cannot share my code, but is it somewhere along the lines of:

When I try to print the gradient of y_predicted (which is the output label) in my training loop after calling .backward(), it gives me None. Can anyone help with where I am going wrong ?
P.S. Please ignore the logic errors in the code.