#[repr(i32)]pub enum Version {
Show 13 variants
StartVersion = 0,
IrVersion20171010 = 1,
IrVersion20171030 = 2,
IrVersion2017113 = 3,
IrVersion2019122 = 4,
IrVersion2019318 = 5,
IrVersion2019919 = 6,
IrVersion202058 = 7,
IrVersion2021730 = 8,
IrVersion202355 = 9,
IrVersion2024325 = 10,
IrVersion20250512 = 11,
IrVersion = 12,
}Expand description
Versioning
ONNX versioning is specified in docs/IR.md and elaborated on in docs/Versioning.md
To be compatible with both proto2 and proto3, we will use a version number that is not defined by the default value but an explicit enum number.
Variants§
StartVersion = 0
proto3 requires the first enum value to be zero. We add this just to appease the compiler.
IrVersion20171010 = 1
The version field is always serialized and we will use it to store the version that the graph is generated from. This helps us set up version control. For the IR, we are using simple numbers starting with 0x00000001, which was the version we published on Oct 10, 2017.
IrVersion20171030 = 2
IR_VERSION 2 published on Oct 30, 2017
- Added type discriminator to AttributeProto to support proto3 users
IrVersion2017113 = 3
IR VERSION 3 published on Nov 3, 2017
- For operator versioning:
- Added new message OperatorSetIdProto
- Added opset_import in ModelProto
- For vendor extensions, added domain in NodeProto
IrVersion2019122 = 4
IR VERSION 4 published on Jan 22, 2019
- Relax constraint that initializers should be a subset of graph inputs
- Add type BFLOAT16
IrVersion2019318 = 5
IR VERSION 5 published on March 18, 2019
- Add message TensorAnnotation.
- Add quantization annotation in GraphProto to map tensor with its scale and zero point quantization parameters.
IrVersion2019919 = 6
IR VERSION 6 published on Sep 19, 2019
- Add support for sparse tensor constants stored in model.
- Add message SparseTensorProto
- Add sparse initializers
IrVersion202058 = 7
IR VERSION 7 published on May 8, 2020
- Add support to allow function body graph to rely on multiple external operator sets.
- Add a list to promote inference graph’s initializers to global and mutable variables. Global variables are visible in all graphs of the stored models.
- Add message TrainingInfoProto to store initialization method and training algorithm. The execution of TrainingInfoProto can modify the values of mutable variables.
- Implicitly add inference graph into each TrainingInfoProto’s algorithm.
IrVersion2021730 = 8
IR VERSION 8 published on July 30, 2021 Introduce TypeProto.SparseTensor Introduce TypeProto.Optional Added a list of FunctionProtos local to the model Deprecated since_version and operator status from FunctionProto
IrVersion202355 = 9
IR VERSION 9 published on May 5, 2023 Added AttributeProto to FunctionProto so that default attribute values can be set. Added FLOAT8E4M3FN, FLOAT8E4M3FNUZ, FLOAT8E5M2, FLOAT8E5M2FNUZ.
IrVersion2024325 = 10
IR VERSION 10 published on March 25, 2024 Added UINT4, INT4, overload field for functions and metadata_props on multiple proto definitions.
IrVersion20250512 = 11
IR VERSION 11 published on May 12, 2025 Added FLOAT4E2M1, multi-device protobuf classes.
IrVersion = 12
IR VERSION 12 published on TBD Added FLOAT8E8M0.
Implementations§
Source§impl Version
impl Version
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Version>
pub fn from_str_name(value: &str) -> Option<Version>
Creates an enum from field names used in the ProtoBuf definition.