Describe the issue:
Relates to #30341 and #30936
In the from_dlpack docs it says:
BufferError – The dlpack and dlpack_device methods on the input array may raise BufferError when the data cannot be exported as DLPack (e.g., incompatible dtype, strides, or device).
I read the meaning as: incompatible dtype, incompatible strides, or incompatible device - which would suggest a BufferError should be raised when device is incompatible?
I understand BufferError may seem like an odd choice (#30341 (comment)) but just raising the question from my interpretation of the docs.
Reproduce the code example:
x_torch = torch.arange(5, device='cuda')
np.from_dlpack(x_torch)
Error message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Unsupported device in DLTensor.
Python and NumPy Versions:
2.4.2
3.14.2 | packaged by conda-forge | (main, Feb 4 2026, 15:49:49) [GCC 14.3.0]
Runtime Environment:
No response
How does this issue affect you or how did you find it:
scikit-learn/scikit-learn#32755 (comment)
Describe the issue:
Relates to #30341 and #30936
In the from_dlpack docs it says:
I read the meaning as: incompatible dtype, incompatible strides, or incompatible device - which would suggest a BufferError should be raised when device is incompatible?
I understand
BufferErrormay seem like an odd choice (#30341 (comment)) but just raising the question from my interpretation of the docs.Reproduce the code example:
Error message:
Python and NumPy Versions:
2.4.2
3.14.2 | packaged by conda-forge | (main, Feb 4 2026, 15:49:49) [GCC 14.3.0]
Runtime Environment:
No response
How does this issue affect you or how did you find it:
scikit-learn/scikit-learn#32755 (comment)