Skip to main content

ArchitectureStateFactory

Trait ArchitectureStateFactory 

Source
pub trait ArchitectureStateFactory<B: NeuralBackend> {
    type State: RuntimeState<B>;
    type Error;

    // Required method
    fn realize(
        &mut self,
        layout: &StateLayout,
    ) -> Result<Self::State, Self::Error>;
}
Expand description

Additive backend mechanism for realizing an architecture-declared state layout.

Ordinary key/value architectures need not implement this extension: it is selected only by composition that requires a distinct concrete state representation, such as a layout combining attention and fixed components.

Required Associated Types§

Source

type State: RuntimeState<B>

Concrete state returned by this realization mechanism.

Source

type Error

Backend-specific construction failure.

Required Methods§

Source

fn realize(&mut self, layout: &StateLayout) -> Result<Self::State, Self::Error>

Allocates native state for the exact selected architecture layout.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§