Grad is None even when I set requires_grad=True

Ah!
Well, I would recommend updating your version of pytorch to the latest. And make sure you don’t have conflicting versions :smiley: