Skip to content

Commit

Permalink
Use protocol for dlpack instead of deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Feb 28, 2025
1 parent 83a29ce commit 395da9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/cudf/cudf/tests/test_dlpack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2024, NVIDIA CORPORATION.
# Copyright (c) 2019-2025, NVIDIA CORPORATION.

import itertools
from contextlib import ExitStack as does_not_raise
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_to_dlpack_cupy_2d(data_2d):
def test_from_dlpack_cupy_1d(data_1d):
cupy_array = cupy.array(data_1d)
cupy_host_array = cupy_array.get()
dlt = cupy_array.toDlpack()
dlt = cupy_array.__dlpack__()

gs = cudf.from_dlpack(dlt)
cudf_host_array = gs.to_numpy(na_value=np.nan)
Expand All @@ -151,7 +151,7 @@ def test_from_dlpack_cupy_1d(data_1d):
def test_from_dlpack_cupy_2d(data_2d):
cupy_array = cupy.array(data_2d, order="F")
cupy_host_array = cupy_array.get().flatten()
dlt = cupy_array.toDlpack()
dlt = cupy_array.__dlpack__()

gdf = cudf.from_dlpack(dlt)
cudf_host_array = np.array(gdf.to_pandas()).flatten()
Expand Down

0 comments on commit 395da9b

Please sign in to comment.