Hi,
You can use autograd.grad to get the gradient wrt a specific set of Tensors without touching any .grad field.
But you seem to be doing that properly in your sample.
Few things:

you want .backward() (without the s)
The way you compute your loss does not match the formula you gave
This code should do what you want.