pub enum OptimizationLevel {
None,
Basic,
All,
}Expand description
Graph-optimization level for the session’s optimize pipeline stage
(docs/ORT2.md §18). Selected via the generic "optimization" session
option (see SessionBuilder::option).
The default is OptimizationLevel::None: with optimization off the graph
reaches the executor exactly as the loader produced it, so default runtime
behavior is byte-identical to a build with no optimizer wired in at all.
This is a generic, model-agnostic knob — no level ever special-cases a model
name or op. Higher levels simply enable more of the device-independent pass
pipeline from onnx_runtime_optimizer.
Variants§
None
No passes — the optimize stage is a no-op (default).
Basic
Structure-preserving passes only: constant folding then dead-node elimination. No operator fusion, so the op set the executor sees is a subset of the loaded graph’s.
All
The full device-independent pipeline: constant folding, dead-node
elimination, and operator fusion (which can introduce fused
com.microsoft contrib ops such as LayerNormalization).
Trait Implementations§
Source§impl Clone for OptimizationLevel
impl Clone for OptimizationLevel
Source§fn clone(&self) -> OptimizationLevel
fn clone(&self) -> OptimizationLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OptimizationLevel
Source§impl Debug for OptimizationLevel
impl Debug for OptimizationLevel
Source§impl Default for OptimizationLevel
impl Default for OptimizationLevel
Source§fn default() -> OptimizationLevel
fn default() -> OptimizationLevel
impl Eq for OptimizationLevel
Source§impl PartialEq for OptimizationLevel
impl PartialEq for OptimizationLevel
impl StructuralPartialEq for OptimizationLevel
Auto Trait Implementations§
impl Freeze for OptimizationLevel
impl RefUnwindSafe for OptimizationLevel
impl Send for OptimizationLevel
impl Sync for OptimizationLevel
impl Unpin for OptimizationLevel
impl UnsafeUnpin for OptimizationLevel
impl UnwindSafe for OptimizationLevel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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