Skip to content

Commit 7141617

Browse files
committed
svd: Let the Python code handle the info != 0 case to avoid XLA error
1 parent a5eaf9f commit 7141617

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

varipeps/utils/extensions/svd_ffi.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ static ffi::Error SvdOnlyUVtImpl(
145145
}
146146

147147
if (*info_data != 0) {
148-
return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
148+
return ffi::Error::Success();
149+
// return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
149150
}
150151

151152
if (std::real(work_size) > lapack_int_max) [[unlikely]] {
@@ -181,9 +182,9 @@ static ffi::Error SvdOnlyUVtImpl(
181182
);
182183
}
183184

184-
if (*info_data != 0) {
185-
return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
186-
}
185+
// if (*info_data != 0) {
186+
// return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
187+
// }
187188

188189
return ffi::Error::Success();
189190
}
@@ -340,7 +341,8 @@ static ffi::Error SvdOnlyUVtQRImpl(
340341
}
341342

342343
if (*info_data != 0) {
343-
return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
344+
return ffi::Error::Success();
345+
// return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
344346
}
345347

346348
if (std::real(work_size) > lapack_int_max) [[unlikely]] {
@@ -373,9 +375,9 @@ static ffi::Error SvdOnlyUVtQRImpl(
373375
);
374376
}
375377

376-
if (*info_data != 0) {
377-
return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
378-
}
378+
// if (*info_data != 0) {
379+
// return ffi::Error(ffi::ErrorCode::kInternal, "Non zero info returned by lapack.");
380+
// }
379381

380382
return ffi::Error::Success();
381383
}

0 commit comments

Comments
 (0)