!42068 添加Cholesky算子对非对称正定输入的校验

Merge pull request !42068 from 李若轩/Cholesky
This commit is contained in:
i-robot 2022-09-16 08:42:21 +00:00 committed by Gitee
commit 5134a26def
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 0 deletions

View File

@ -112,6 +112,9 @@ bool CholeskyCpuKernelMod::LaunchKernel(const std::vector<AddressPtr> &inputs, c
}
}
} else {
if (!input.isApprox(input.transpose()) || llt.info() == Eigen::NumericalIssue) {
MS_LOG_EXCEPTION << "Cholesky expects symmetric positive definite matrices as inputs.";
}
if (!upper_) {
output = llt.matrixL();
} else {