Skip to content

Add view/copy informational flag #134

@seberg

Description

@seberg

There is a discussion in the array api about adding a nocopy request to the Python API. While it might be nice to solve such requests at a lower level in C, it isn't vital where the request happens.

However, there is a point that often the user doesn't care, but still would like to know if they got a copy (own the data effectively) or not (a view).

So if we go through the trouble of having a request flag, I think we must also add this informational flag in the struct (probably 1 being set meaning that a copy is returned for whatever reason: the consumer is the sole user of the data).

Yes, this isn't what DLPack had in mind when designed, but it seems like it is a natural extension of an exchange protocol.

(The request API still is useful with this, since it allows the consumer to say that they require a view, allowing to fail early.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions