Skip to main content

RuntimeStateComponents

Trait RuntimeStateComponents 

Source
pub trait RuntimeStateComponents<B: NeuralBackend>: RuntimeLayerState<B> {
    // Required methods
    fn position(&self) -> i32;
    fn fixed_component(
        &mut self,
        role: StateTensorRole,
    ) -> Result<&mut Option<B::Tensor>, StateError>;
    fn advance_fixed(&mut self, tokens: i32) -> Result<(), StateError>;
}
Expand description

Mutable access to architecture-declared fixed state components.

Operators address semantic roles rather than backend storage. Concrete realizations keep native tensors and may combine these slots with an append-only attention cache in the same layer state.

Required Methods§

Source

fn position(&self) -> i32

Current absolute token frontier for this layer.

Source

fn fixed_component( &mut self, role: StateTensorRole, ) -> Result<&mut Option<B::Tensor>, StateError>

Borrows the optional tensor slot for one declared fixed component.

Source

fn advance_fixed(&mut self, tokens: i32) -> Result<(), StateError>

Advances a fixed-state-only layer after a successful operator call.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§