Solved by ptrblck in post #2 
              
              
                You could reassign a new nn.Parameter to your weights or just set the values depending on your use case. 
Here is a small example how to assign new parameters: 
with torch.no_grad():
    model.conv1.weight = nn.Parameter(torch.randn(64, 3, 7, 7))
    # or
    model.conv1.weight.copy_(torch.randn(64,…