Hey,
Note that symeig accepts batch of inputs. So you can actually give it your whole S_B at once.
Other than that, I don’t think there is much to do. eigenvalue decomposition is quite expensive. Note that if you’re on the GPU and using small Tensors, it might be better to send them back to the CPU before doing the symeig.