In-API way of catching `torch._C._LinAlgError`

Hello,

Is there an in-API way of catching torch._C._LinAlgError – risen upon torch.linalg.inv_ex failure on singular matrices when check_errors=True?

Thanks!

Edit: I should precise that I also get a mypy error when trying to use it as is.

error: Module has no attribute "_LinAlgError"  [attr-defined]

I found torch.linalg.LinAlgError!

>>> torch.linalg.LinAlgError is torch._C._LinAlgError
True