Hello everyone,
I am trying to copy a tensor with custom weights into an AlexNet convolutional layer weights. I am doing as indicated below and I dont get any error. However when I load the model using torch::load and check the weights, they are different than the values that I saved with torch::save function. Am I missing something?
AlexNet model;

 model->named_parameters()["conv1.weights"] = tensor_with_custom_weights.clone().detach();

// if I check it here weights are correct, the ones that I assigned
torch::save("alexnet.pt",model);

AlexNet model1;
torch::load("alexnet.pt",model1);
//Here model1.conv1.weights are random


Thanks