Ok thanks for details.
So I can use it together during validation loop.
But I haven’t find a way to do the opposite of no_grad() (to be back in training mode).
Edit:
Maybe I’ve just found it : torch.set_grad_enabled(True)
Is it this instruction ?