Lost_Wanderer:

norm = torch.sqrt(sum(torch.sum((p.grad**2)) for p in params))


I am not sure how d2l is handling the training routine. From the error, it seems that for some of the params, the gradient was None (i.e., p.grad was None). Hence, the error.
Perhaps you might have to delete the unused params (for example, W_xr, W_xh etc.,)?