Struct DLPackVersion
#[repr(C)]pub struct DLPackVersion {
pub major: u32,
pub minor: u32,
}Expand description
The DLPack version.
A change in major version indicates that we have changed the data layout of the ABI - DLManagedTensorVersioned.
A change in minor version indicates that we have added new code, such as a new device type, but the ABI is kept the same.
If an obtained DLPack tensor has a major version that disagrees with the version number specified in this header file (i.e. major != DLPACK_MAJOR_VERSION), the consumer must call the deleter (and it is safe to do so). It is not safe to access any other fields as the memory layout will have changed.
In the case of a minor version mismatch, the tensor can be safely used as long as the consumer knows how to interpret all fields. Minor version updates indicate the addition of enumeration values.
Fields§
§major: u32DLPack major version.
minor: u32DLPack minor version.
Implementations§
§impl DLPackVersion
impl DLPackVersion
pub const fn current() -> DLPackVersion
pub const fn current() -> DLPackVersion
Returns the DLPack version supported by this library.
Trait Implementations§
§impl Clone for DLPackVersion
impl Clone for DLPackVersion
§fn clone(&self) -> DLPackVersion
fn clone(&self) -> DLPackVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more