dmlc / dmlc/dlpack

Smaller fixups for "versioned" struct/docs and clarifications

Open
#145 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.2k
Forks
169
PR merge metrics
No merged PRs in 30d

Description

When implementing things for NumPy, I noticed a few things:
* All other structs are also `typedef`'d, the new `...Versioned` is not.
* In our discussions at some point we had a large comment in place for how far `DLTensorVersioned` is ABI stable. This is missing (i.e. we want everything up to and including the flags to be ABI stable, after that all bets are off for major versions).
* When the major version changes, we may need a new struct. I am wondering if it might still make sense to just rip the band-aid off and *remove* `dl_tensor` from the `...Versioned` struct and introduce a `...V1` which _includes_ it.
That would make it abundantly clear that you need to cast. If v2 doesn't need a new struct, could make it an alias or just document that?

On the Python side, `copy=True` and espeically `copy=None` behavior could be clarified. I did the lazy path in NumPy and just always copied with `copy=True`.
In very rare cases that might make an array exportable, which isn't without `copy=True` (due to odd strides).

It may make sense to clarify that `copy=None` is *only* required to do copies to make device requests work (if they are supported).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.