-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove warning in from_dlpack and to_dlpack methods #7001
Conversation
Fix #6926 . Hi, Hi! When invoking from_dlpack() and to_dlpack, the following warnings are displayed: from_dlpack() /opt/conda/envs/rapids/lib/python3.7/site-packages/cudf/io/dlpack.py:33: UserWarning: 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. res = libdlpack.from_dlpack(pycapsule_obj) to_dlpack() /opt/conda/envs/rapids/lib/python3.7/site-packages/cudf/io/dlpack.py:74: UserWarning: 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. return libdlpack.to_dlpack(gdf_cols) I think those warnings should be removed, because it contains information that should be available in the API documentation, and not necessarily displayed each time the methods are invoked. Some users, like me, love to have their notebooks/code without warnings. Even if it is possible to disable those warnings, I think the user should not go that way, because the warning is just repeating what the API documentation should cover. Hope it helps! Miguel
Codecov Report
@@ Coverage Diff @@
## branch-0.18 #7001 +/- ##
============================================
Coverage 82.01% 82.01%
============================================
Files 96 96
Lines 16338 16340 +2
============================================
+ Hits 13400 13402 +2
Misses 2938 2938
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the warnings being removed in both of the from_dlpack
& to_dlpack
under notes in pydocs here: https://github.com/rapidsai/cudf/blob/598a14d820d47b7c3bfcb2bb3341b97a85317646/python/cudf/cudf/io/dlpack.py
Moved API documentation from warning message to API doc.
Thank you for your review @galipremsagar. I have just added the requested comments accordingly. |
Removed trailing space and reduced the line length to <=80
I have just moved the warning to a NOTES section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have to update copyright in python/cudf/cudf/io/dlpack.py
Updated copyright notice from 2019 to 2019-2020.
Fix #6926 .
Hi!
When invoking from_dlpack() and to_dlpack, the following warnings are displayed:
from_dlpack()
to_dlpack()
I think those warnings should be removed, because it contains information that should be available in the API documentation, and not necessarily displayed each time the methods are invoked.
Some users, like me, love to have their notebooks/code without warnings. Even if it is possible to disable those warnings, I think the user should not go that way, because the warning is just repeating what the API documentation should cover.
Hope it helps!
Miguel