If you want to manually update the parameters, this dummy code snippet should work:
with torch.no_grad():
    for param in model.parameters():
        param -= learning_rate * param.grad

I’m not sure how your use case works and how you are calculating the un_params.
Could you explain it a bit?