#[non_exhaustive]pub struct PassContext { /* private fields */ }Expand description
Shared, read-only context threaded through every pass.
Phase-1 minimalism. The design in docs/ORT2.md §18.1 gives this struct
cost_model, ep_registry, and target_devices fields. Those depend on
crates or analyses that do not exist yet, and none of the device-independent
Phase-1 passes
(DeadNodeElimination,
ConstantFolding, OpFusion)
need them. The only current service is an optional initializer resolver for
EP-scoped passes that physically rewrite immutable weights.
It is #[non_exhaustive] so the Phase-2b cost-model / EP-registry /
placement fields can be added without breaking downstream construction.
Implementations§
Source§impl PassContext
impl PassContext
Sourcepub fn with_initializer_resolver(
self,
resolver: Arc<dyn InitializerResolver>,
) -> Self
pub fn with_initializer_resolver( self, resolver: Arc<dyn InitializerResolver>, ) -> Self
Attach the resolver that exposes inline or externally mapped initializer bytes to passes that rewrite immutable weights.
Sourcepub fn initializer_bytes<'b>(
&'b self,
weight: &'b WeightRef,
) -> Option<&'b [u8]>
pub fn initializer_bytes<'b>( &'b self, weight: &'b WeightRef, ) -> Option<&'b [u8]>
Resolve an initializer’s raw bytes. Inline initializers are always available; external references require an attached resolver.
Trait Implementations§
Source§impl Clone for PassContext
impl Clone for PassContext
Source§fn clone(&self) -> PassContext
fn clone(&self) -> PassContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more