Solved by ptrblck in post #4 
              
              
                I’m not sure I understand the question correctly. 
You could initialize a model with random parameters via your code snippet or generally as: 
model = MyModel()

where MyModel is the model class. Afterwards, you could load the state_dict via model.load_state_dict(state_dict). 
The difference between…