I guess what you want is:
# Compute your loss as usual
out = model(input)
loss = loss_module(out, target)

# zero all gradients and backward
optimizer.zero_grad()
loss.backward()

# reset the gradients for the loss parameter
loss_module.zero_grad()

# compute the gradients for your loss parameters and set them
my_param_grad = get_params_grad(...)
loss_module.parameter.backward(my_params_grad) # EDITED: used to be `parameters` which is wrong

# now update all the parameters
optimizer.step()