Skip to content
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

Minor clarification for conflicting information in __dlpack__ #831

Open
ndgrigorian opened this issue Aug 1, 2024 · 1 comment
Open
Labels
bug Something isn't working. topic: DLPack DLPack.
Milestone

Comments

@ndgrigorian
Copy link

The specification page for __dlpack__ requires the following two, conflicting things:

for the dlpack_device argument

The v2023.12 standard only mandates that a compliant library should offer a way for dlpack to return a capsule referencing an array whose underlying memory is accessible to the Python interpreter (represented by the kDLCPU enumerator in DLPack). If a copy must be made to enable this support but copy is set to False, the function must raise ValueError.

for the copy argument

If False, the function must never copy, and raise a BufferError in case a copy is deemed necessary (e.g. if a cross-device data movement is requested, and it is not possible without a copy).

These appear to be mutually exclusive and in direct conflict. It would be nice to clarify the correct intention

@kgryte kgryte added this to the v2024 milestone Aug 1, 2024
@leofang
Copy link
Contributor

leofang commented Sep 19, 2024

Thanks for catching this. It seems raising ValueError is a mistake.

@kgryte kgryte added bug Something isn't working. topic: DLPack DLPack. labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. topic: DLPack DLPack.
Projects
None yet
Development

No branches or pull requests

3 participants