Matrix Inversion RuntimeError: MAGMA getrf


I’m using matrix inversing function to run the following code but meet the RuntimeError:

GD =,D).cuda(), GD.inverse())

RuntimeError: MAGMA getrf : U(33,33) is 0, U is singular at /pytorch/torch/lib/THC/generic/

Could anybody help me on this? Thanks a lot!

You should make sure that GD is nonsingular (, and it’s eigenvalues are not very small to avoid numerical issues).

1 Like

Thanks Simon for reminding! It does show that the GD is singular originally. We fixed it.