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).
When implementing things for NumPy, I noticed a few things:
typedef'd, the new...Versionedis not.DLTensorVersionedis 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).dl_tensorfrom the...Versionedstruct and introduce a...V1which 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=Trueand espeicallycopy=Nonebehavior could be clarified. I did the lazy path in NumPy and just always copied withcopy=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=Noneis only required to do copies to make device requests work (if they are supported).