It’s mostly correct yes, I would say it slightly differently:

a.requires_grad=True means that we will ask for gradients later and so the autograd should save everything that it needs to be able to do so.
a.is_leaf=True means that it was not computed in a differentiable manner (either created by the user or from Tensors that don’t require gradients). For such Tensor, if we compute their gradient, it should be saved in a.grad.
loss.backward() means compute the gradients for all the Tensor that require gradients that were used to create loss. By side effect, this will populate the .grad field of all the leafs that require gradients.
optimizer.step() is then used to update a using a.grad (note that a.grad gives a direction of descent for the loss above).