Skip to content

Commit

Permalink
Fixup explicit-copy condition check.
Browse files Browse the repository at this point in the history
To account for input datasets with 1-length shapes.
  • Loading branch information
csadorf committed Jul 27, 2023
1 parent 0e75977 commit 5875b37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/cuml/linear_model/linear_regression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ class LinearRegression(LinearPredictMixin,
"""
cdef uintptr_t X_ptr, y_ptr, sample_weight_ptr

need_explicit_copy = self.copy_X and hasattr(X, "__cuda_array_interface__") and X.shape[1] == 1
need_explicit_copy = self.copy_X and hasattr(X, "__cuda_array_interface__") \
and (len(X.shape) < 2 or X.shape[1] == 1)

X_m, n_rows, self.n_features_in_, self.dtype = \
input_to_cuml_array(X,
Expand Down

0 comments on commit 5875b37

Please sign in to comment.