I’m not sure I understand the question completely, but if you would like to grab the gradient at specific parameters, you could use hooks as:
model.layer.param.register_hook(my_hook)

and manipulate or print out the gradient.
Would this work or could you explain, what loss you would like to see?