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 more