pub trait RuntimeState<B: NeuralBackend> {
type RetainedValues<'a>: Iterator<Item = &'a B::Tensor>
where Self: 'a,
B::Tensor: 'a;
// Required methods
fn layout(&self) -> &StateLayout;
fn retained_values(
&self,
ordinal: usize,
address: ExecutionUnitAddress,
) -> Result<Self::RetainedValues<'_>, StateError>;
// Provided method
fn optional_layout(&self) -> Option<&StateLayout> { ... }
}Expand description
Mutable state realization consumed by generic resident and layerwise engines.
Required Associated Types§
Sourcetype RetainedValues<'a>: Iterator<Item = &'a B::Tensor>
where
Self: 'a,
B::Tensor: 'a
type RetainedValues<'a>: Iterator<Item = &'a B::Tensor> where Self: 'a, B::Tensor: 'a
Concrete iterator retaining native values for one execution unit.
Required Methods§
Sourcefn layout(&self) -> &StateLayout
fn layout(&self) -> &StateLayout
Returns the exact layout used to create this realization.
Sourcefn retained_values(
&self,
ordinal: usize,
address: ExecutionUnitAddress,
) -> Result<Self::RetainedValues<'_>, StateError>
fn retained_values( &self, ordinal: usize, address: ExecutionUnitAddress, ) -> Result<Self::RetainedValues<'_>, StateError>
Borrows tensors retained by one execution unit without cloning handles.
The flat ordinal addresses policy storage while address preserves
architecture-group semantics for composite and shared state.
Provided Methods§
Sourcefn optional_layout(&self) -> Option<&StateLayout>
fn optional_layout(&self) -> Option<&StateLayout>
Returns state geometry, or None for an explicit rank with no mutable state.
Existing stateful realizations inherit the strict layout. Stateless implementations override this method so generic session control never invents sentinel state geometry.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".