i want to set manually parameters to model, i tried to do something like:
for name, p in updated_model.all_named_parameters():
p = result_params[name]
p.retain_grad()
but it seems that it’s only changes p, but not the network.
i need the grad inside result_params for the network, so i don’t want to use something like “p.data = …” .
thanks a lot.
yoav