Inf error - pytorch

Hi I am trying to fit linear regression in pytorch. but I am getting inf error after certain epoch
Notebook Link

That’s probably because you’re doing zero_grad just before calling loss.backward.
Try changing it before the model call.