Skip to content

Minor clarification for conflicting information in __dlpack__ #831

Closed
@ndgrigorian

Description

@ndgrigorian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions