Can you provide a simple example?
Say we have:
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.fc1=nn.Linear(784,10)
        self.fc2=nn.Linear(10,10)

    def forward(self, x):
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        return x

#instantiate the model
net=Net()

crit=nn.CrossEntropyLoss()
opt=optim.SGD(net.parameters(), lr=0.001)

inputs, labels =torch.rand(4,784), torch.tensor([1,2,3,4])

opt.zero_grad()
outputs = net(inputs)
loss= crit(outputs, labels)
loss.backward()

#New parameters for change 10 ---->15 neuron hidden layer
new_params=torch.rand(15,784),torch.rand(15),torch.rand(15,10),torch.rand(10)

#Some additional code here to insert new_params to replace net's layers(both in size and values)

# end code and continue to train new model

opt.zero_grad()
outputs = net(inputs)
loss= crit(outputs, labels)
loss.backward()
...

How can I replace the old parameters and layer sizes with new parameters and layers?