Say I have a list of parameters called p_new and each parameter has a grad_fn which I care about.
I would like to update net.parameters() like this:
for param, pi in zip(net.parameters(), p_new):
        param = pi # I don't wanna update data only!


Of course this doesn’t work. Any alternatives?