Thank you, I’ll add a warning to the docs to warn against the eigenvectors of torch.eig not being orthonormal.
I’ll also do some more investigation. numpy’s eig binds to Lapack (which is the same thing that torch.eig does on the CPU), so it seems weird to me that some inputs are strange. For example, for most of the cases I tested, when given a symmetric input torch.eig usually returns orthonormal vectors.
Here’s a github issue to track my progress: https://github.com/pytorch/pytorch/issues/4533 121. Feel free to follow along there, and/or I’ll post more updates on this thread as well.