Avoid for loop over spins in backward transform.
Avoid for loop over spins in backward transform.

This increases training speed of a large model by around 5%.

PiperOrigin-RevId: 459100912

google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research,google-research/google-research