Skip to main content

ABI_VERSION

Constant ABI_VERSION 

Source
pub const ABI_VERSION: u32 = 1;
Expand description

Protocol version, checked by TensorDyn::import_descriptor after the payload has already been read as this build’s TensorDesc.

This is the second line of defense, not the gate: it cannot catch a producer whose TensorDesc is a different size, since the out-of-bounds/misaligned read has already happened by the time this field could be inspected. The capsule name (edgefirst_tensor_v2, see INTEROP.md’s Versioning section) is what actually gates that – checked by PyCapsule::pointer_checked before any byte of the payload is read. DLPack reached the same conclusion after shipping an unversioned dltensor capsule and finding no upgrade path: its v1.0 fix added both a version field and a new capsule name, because the field alone is unreadable until the layout is already known.

This field stays useful for the case the name rule does not cover on its own: a future change to what a same-sized, same-layout TensorDesc’s fields mean. It has not needed to move past 1.