Torch.potrf failing but np.linalg.cholesky works

I’m trying to parameterise a full covariance matrix – I’ve done this by declaring a tensor variable and multiplying it by it’s transpose. Pytorch is throwing an error though when I try and call torch.potrf on it though:

RuntimeError: Lapack Error in potrf : the leading minor of order 8 is not positive definite at /Users/soumith/code/builder/wheel/pytorch-src/aten/src/TH/generic/THTensorLapack.c:617

I’ve checked though and it does actually seem to be a positive semidefinite matrix, and np.linalg.cholesky works. I’ve uploaded the matrix here.

Same Problem. Looking forward to the solutions. Mark.

1 Like