cur_z_arr[j].grad is None after when the code is executed. I don't know why. I also tried cur_z_arr[j].retain_grad() right before energy.backward()
2.1m questions
2.1m answers
60 comments
57.0k users