diff --git a/python/cudf/cudf/_lib/interop.pyx b/python/cudf/cudf/_lib/interop.pyx index 2b38f6b655f..04971b58cd2 100644 --- a/python/cudf/cudf/_lib/interop.pyx +++ b/python/cudf/cudf/_lib/interop.pyx @@ -1,7 +1,6 @@ # Copyright (c) 2020, NVIDIA CORPORATION. import cudf -import warnings from cudf._lib.table cimport Table from libcpp.vector cimport vector @@ -32,10 +31,6 @@ def from_dlpack(dlpack_capsule): DLPack Tensor PyCapsule is expected to have the name "dltensor". """ - warnings.warn("WARNING: cuDF from_dlpack() assumes column-major (Fortran" - " order) input. If the input tensor is row-major, transpose" - " it before passing it to this function.") - cdef DLManagedTensor* dlpack_tensor = pycapsule.\ PyCapsule_GetPointer(dlpack_capsule, 'dltensor') pycapsule.PyCapsule_SetName(dlpack_capsule, 'used_dltensor') @@ -61,11 +56,6 @@ def to_dlpack(Table source_table): DLPack Tensor PyCapsule will have the name "dltensor". """ - - warnings.warn("WARNING: cuDF to_dlpack() produces column-major (Fortran " - "order) output. If the output tensor needs to be row major, " - "transpose the output of this function.") - for column in source_table._columns: if column.null_count: raise ValueError( diff --git a/python/cudf/cudf/io/dlpack.py b/python/cudf/cudf/io/dlpack.py index 3db3b056f87..65055293804 100644 --- a/python/cudf/cudf/io/dlpack.py +++ b/python/cudf/cudf/io/dlpack.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019, NVIDIA CORPORATION. +# Copyright (c) 2019-2020, NVIDIA CORPORATION. from cudf._lib import interop as libdlpack from cudf.core.column import ColumnBase @@ -28,6 +28,11 @@ def from_dlpack(pycapsule_obj): ------- A cuDF DataFrame or Series depending on if the input DLPack tensor is 1D or 2D. + + Notes + ----- + cuDF from_dlpack() assumes column-major (Fortran order) input. If the input + tensor is row-major, transpose it before passing it to this function. """ res = libdlpack.from_dlpack(pycapsule_obj) @@ -46,8 +51,8 @@ def to_dlpack(cudf_obj): `dmlc/dlpack `_. This function takes a cuDF object as input, and returns a PyCapsule object - which contains a pointer to DLPack tensor. This function deep - copies the data in the cuDF object into the DLPack tensor. + which contains a pointer to DLPack tensor. This function deep copies + the data in the cuDF object into the DLPack tensor. Parameters ---------- @@ -57,6 +62,11 @@ def to_dlpack(cudf_obj): Returns ------- A DLPack tensor pointer which is encapsulated in a PyCapsule object. + + Notes + ----- + cuDF to_dlpack() produces column-major (Fortran order) output. If the + output tensor needs to be row major, transpose the output of this function. """ if len(cudf_obj) == 0: raise ValueError("Cannot create DLPack tensor of 0 size")