pub trait RealtimeModelConstructionMechanisms<A, B>where
B: SubmissionBackend<Executor = <<B as NeuralBackend>::Tensor as Tensor>::Context>,
A: LayeredArchitecture<B, Self::State>,
Self::State: RuntimeState<B>,
Self::ResidentPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>,
Self::BoundedPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>,{
type State: RuntimeState<B>;
type PolicyError;
type ResidentPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>;
type BoundedPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>;
type Error;
// Required methods
fn prepare_resident_materialization(
&mut self,
architecture: &mut A,
units: &mut [A::Unit],
source_architecture: Option<&mut A>,
source_units: Option<&mut [A::Unit]>,
tasks: &[RealtimeMaterializationTask],
selected: &SelectedRealtimeRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<(), Self::Error>;
fn resident_policy(
&mut self,
architecture: &mut A,
units: Vec<A::Unit>,
selected: &SelectedRealtimeRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<RealizedRealtimePolicy<Self::ResidentPolicy>, Self::Error>;
fn bounded_policy(
&mut self,
architecture: &mut A,
source_architecture: Option<&mut A>,
tasks: &[RealtimeMaterializationTask],
selected: &SelectedRealtimeRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<RealizedRealtimePolicy<Self::BoundedPolicy>, Self::Error>;
fn realize_state(
&mut self,
selected: &SelectedRealtimeStateRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<RealizedRealtimeState<Self::State>, Self::Error>;
}Expand description
Generic mechanisms used only to materialize and store a selected model.
Required Associated Types§
Sourcetype State: RuntimeState<B>
type State: RuntimeState<B>
Concrete architecture state realization.
Sourcetype PolicyError
type PolicyError
Shared resident/bounded policy failure.
Sourcetype ResidentPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>
type ResidentPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>
Fully resident unit storage.
Sourcetype BoundedPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>
type BoundedPolicy: LayerwisePolicy<B, A::Unit, Error = Self::PolicyError>
Host-windowed or disk-streamed unit storage.
Required Methods§
Sourcefn prepare_resident_materialization(
&mut self,
architecture: &mut A,
units: &mut [A::Unit],
source_architecture: Option<&mut A>,
source_units: Option<&mut [A::Unit]>,
tasks: &[RealtimeMaterializationTask],
selected: &SelectedRealtimeRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<(), Self::Error>
fn prepare_resident_materialization( &mut self, architecture: &mut A, units: &mut [A::Unit], source_architecture: Option<&mut A>, source_units: Option<&mut [A::Unit]>, tasks: &[RealtimeMaterializationTask], selected: &SelectedRealtimeRealization, context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, ) -> Result<(), Self::Error>
Materializes and binds every resident static/unit component exactly once.
Sourcefn resident_policy(
&mut self,
architecture: &mut A,
units: Vec<A::Unit>,
selected: &SelectedRealtimeRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<RealizedRealtimePolicy<Self::ResidentPolicy>, Self::Error>
fn resident_policy( &mut self, architecture: &mut A, units: Vec<A::Unit>, selected: &SelectedRealtimeRealization, context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, ) -> Result<RealizedRealtimePolicy<Self::ResidentPolicy>, Self::Error>
Builds fully resident storage around populated units.
Sourcefn bounded_policy(
&mut self,
architecture: &mut A,
source_architecture: Option<&mut A>,
tasks: &[RealtimeMaterializationTask],
selected: &SelectedRealtimeRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<RealizedRealtimePolicy<Self::BoundedPolicy>, Self::Error>
fn bounded_policy( &mut self, architecture: &mut A, source_architecture: Option<&mut A>, tasks: &[RealtimeMaterializationTask], selected: &SelectedRealtimeRealization, context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, ) -> Result<RealizedRealtimePolicy<Self::BoundedPolicy>, Self::Error>
Builds selected bounded storage without eagerly constructing every unit.
Sourcefn realize_state(
&mut self,
selected: &SelectedRealtimeStateRealization,
context: &<<B as NeuralBackend>::Tensor as Tensor>::Context,
) -> Result<RealizedRealtimeState<Self::State>, Self::Error>
fn realize_state( &mut self, selected: &SelectedRealtimeStateRealization, context: &<<B as NeuralBackend>::Tensor as Tensor>::Context, ) -> Result<RealizedRealtimeState<Self::State>, Self::Error>
Realizes exact selected state components and placements.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".