Spin-transfer and spin-orbit torques in the Landau–Lifshitz–Gilbert equation