Loss function unexpected behaviour when passing learnable parameter in forward function

Accessing model learnable parameters using (model.variable_name.weight) and trying to update it with external function

Could you describe the issue you are facing a bit more, please?
Do you get an unexpected error or is your workflow failing in any other way?