RuntimeError: false INTERNAL ASSERT FAILED at "../aten/src/ATen/native/BatchLinearAlgebra.cpp":1491, please report a bug to PyTorch. torch.linalg.ldl_factor: Unknown error code: 1381

torch.linalg.ldl_factor bugs out when applied to a symmetric, but non-PD matrix. I am not sure what the exact algorithm is, but I was expecting the “modified Cholesky” used in Newton optimization steps to correct the Hessian to be P.D. What does this error mean?

Could you post a minimal and executable code snippet to reproduce the issue as well as the output of python -m torch.utils.collect_env, please?