phan_phan:

@mailcorahul Variable did not necessarily mean requires_grad=True .


Okay.



 phan_phan:

You could try to define optimizer on net.parameters() after calling net=net.to(device) .


Yes, I tried doing this. Seems to work fine both ways(which is not intuitive).
I guess it still isn’t the cause.