#[repr(i32)]pub enum Version {
StartVersion = 0,
IrVersion20171010 = 1,
IrVersion20171030 = 2,
IrVersion2017113 = 3,
IrVersion2019122 = 4,
IrVersion2019318 = 5,
IrVersion2019919 = 6,
IrVersion202058 = 7,
IrVersion = 8,
}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 opreator 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.
IrVersion = 8
IR VERSION 8 published on
Implementations§
Trait Implementations§
Source§impl Ord for Version
impl Ord for Version
Source§impl PartialOrd for Version
impl PartialOrd for Version
impl Copy for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClampCast for Twhere
T: PartialOrd + Copy + 'static,
impl<T> ClampCast for Twhere
T: PartialOrd + Copy + 'static,
fn clamp_cast<O>(self) -> O
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more