Skip to content

Commit c3b0a02

Browse files
authored
Fix _check_X_y (#2023)
1 parent 138ed18 commit c3b0a02

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

onedal/utils/validation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,13 @@ def _check_X_y(
194194

195195
if not accept_2d_y:
196196
y = _column_or_1d(y, warn=True)
197+
else:
198+
y = np.ascontiguousarray(y)
199+
197200
if y_numeric and y.dtype.kind == "O":
198201
y = y.astype(np.float64)
199-
_assert_all_finite(y)
202+
if force_all_finite:
203+
_assert_all_finite(y)
200204

201205
lengths = [X.shape[0], y.shape[0]]
202206
uniques = np.unique(lengths)

0 commit comments

Comments
 (0)