oh ok, so I made a mistake on your issue. The reason why you’re getting that error is that torch.autograd.grad is taking the gradient of new_loss which solely depends on Student with respect to the parameters of Teacher. This is equal to zero by definition as Student doesn’t contain teacher_parmas