The teacher_emb is not needed to calculate gradient.
So I’ve fixed required_grad as False.
Only student_emb in needed to calculate gradient.
for param in student_net.parameters():
    param.requires_grad=True
for param in teacher_net.parameters():
    param.requires_grad=False