Thank you so much! Just one more question:
What if we want to use  loss.backward() and optimizer.step() to update the parameter x? How to rewrite the expression: torch.autograd.grad(df_da(x, y), (y,))?
Formally, we want to do:

I know the question is a bit blur. If you need any clarification, please let me know.
Thanks again!