.grad() is that basic function that computes gradients.
.backward() has a side effect of changing the .grad attributes and is convenient when working with neural nets.
You can replace one by the other “easily” but it won’t be so convenient.
To replace grad by backward:

Save all the .grad attributes on all leafs
Reset the required variables .grad field to 0
call backward (this might do more work than needed)
extract from the variables .grad field their gradients
restore the original .grad attributes

To replace backward by grad:

call grad with all the leafs (model.parameters() for example)
accumulate all the gradients you got in the .grad field of the corresponding variable