@Anders_G
Let me clarify.
This won’t affect parallel, you can split your batch in multiple threads or different cores. try/catch only wrapped your cholesky code, so the exception won’t stop your process. It will be a little bit slower compare to not using try/catch.
The only thing is that you can only process one matrix at a time, though pytorch cholesky function support batches, but it will stop when process a not-valid matrix. What you can do is to have a loop, and process one matrix each time with try/catch so it won’t break, if you want to print out error, you can catch(std::exception& e) and print the error msg. You can scale the loop in multiple threads or cores for sure.