Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8481edc

Browse filesBrowse files
ogriseljeremiedbb
authored andcommitted
FIX avoid warning in input validation with array_api_strict (scikit-learn#29086)
1 parent b254b0f commit 8481edc
Copy full SHA for 8481edc

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎sklearn/utils/validation.py

Copy file name to clipboardExpand all lines: sklearn/utils/validation.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ def _assert_all_finite(
9595
):
9696
"""Like assert_all_finite, but only for ndarray."""
9797

98-
xp, _ = get_namespace(X)
98+
xp, is_array_api = get_namespace(X)
9999

100100
if _get_config()["assume_finite"]:
101101
return
102102

103103
X = xp.asarray(X)
104104

105105
# for object dtype data, we only check for NaNs (GH-13254)
106-
if X.dtype == np.dtype("object") and not allow_nan:
106+
if not is_array_api and X.dtype == np.dtype("object") and not allow_nan:
107107
if _object_dtype_isnan(X).any():
108108
raise ValueError("Input contains NaN")
109109

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.