I am trying to implement a small CNN with PyTorch .I have changed the model.named_parameters() with other numbers, nothing else is changed. Could someone please help me with this issue? with the following logic, I updated the new weights.
count=0
for name,param in model.named_parameters():
    print(type(param.data))
    print("before:",param.data)
    #sizes is the sizes of the weights
    #un_params is my new wieghts list of all layers
    if(len(sizes[count])==1):
        param.data=torch.from_numpy(un_params[count][0])
    else:
        param.data=torch.as_tensor(un_params[count])
    print(type(param.data))
    print("after :",param.data)
    count+=1