loss.backward() won’t throw an error, since you input requires gradients.
If you remove the A.requires_grad_(True), you’ll get an error.
After calling backward all model parameter gradients are still None.