no_grad disable autograd machinery. Nothing can be updated with torch no grad.
It is used to speed up evaluation and optimize memory usage in inference. For regular training you cannot use that and it won’t work as you have seen.