ptrblck:

nn.Parameters , which hold the requires_grad attribute


model = models.resnet50()
sd = model.state_dict()
sd[‘fc.weight’] has both .data and .requires_grad attribute
So looking at the information that it holds it feels like saving the state_dict should be saving the requires_grad flag too…
Can you pls help me on that…