Skip to content

Commit

Permalink
Can't use copy=None on some older NumPy versions...
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed Jul 16, 2024
1 parent 1e912c0 commit 72f456f
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions python/cuml/internals/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,19 +1168,20 @@ def from_input(
)

make_copy = force_contiguous and not arr.is_contiguous
if not make_copy:
# NumPy now interprets False as never copy, so must use None
make_copy = None

if (
not fail_on_order and order != arr.order and order != "K"
) or make_copy:
arr = cls(
arr.mem_type.xpy.array(
arr.to_output("array"), order=order, copy=make_copy
),
index=index,
)
if make_copy:
data = arr.mem_type.xpy.array(
arr.to_output("array"), order=order
)
else:
data = arr.mem_type.xpy.asarray(
arr.to_output("array"), order=order
)

arr = cls(data, index=index)

n_rows = arr.shape[0]

Expand Down

0 comments on commit 72f456f

Please sign in to comment.