pub struct AprModel {
pub version: u32,
pub model_type: String,
pub layers: Vec<ModelLayer>,
pub metadata: HashMap<String, String>,
}Expand description
Aprender model (.apr file).
Fields§
§version: u32Format version
model_type: StringModel type (e.g., “linear”, “mlp”, “transformer”)
layers: Vec<ModelLayer>Model layers
metadata: HashMap<String, String>Model metadata
Implementations§
Source§impl AprModel
impl AprModel
Sourcepub fn add_layer(&mut self, layer: ModelLayer)
pub fn add_layer(&mut self, layer: ModelLayer)
Add a layer to the model.
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Get total parameter count.
Sourcepub fn load(data: &[u8]) -> Result<Self, FormatError>
pub fn load(data: &[u8]) -> Result<Self, FormatError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AprModel
impl RefUnwindSafe for AprModel
impl Send for AprModel
impl Sync for AprModel
impl Unpin for AprModel
impl UnwindSafe for AprModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more