pub struct Layer { /* private fields */ }Expand description
A single CPU layer with automatic pipeline cleanup.
Implementations§
Source§impl Layer
impl Layer
Sourcepub unsafe fn load_param(&mut self, parameters: &ParamDict) -> Result<()>
pub unsafe fn load_param(&mut self, parameters: &ParamDict) -> Result<()>
Loads layer-specific parameters before pipeline creation.
§Safety
Parameters must satisfy the selected layer’s shape, type, and range contract.
Sourcepub unsafe fn load_model(&mut self, model: ncnn_modelbin_t) -> Result<()>
pub unsafe fn load_model(&mut self, model: ncnn_modelbin_t) -> Result<()>
Loads weights through an upstream ModelBin.
§Safety
The model and its reader must be valid for this call. Borrowed weight storage and allocator dependencies must remain valid until the layer is destroyed.
Sourcepub unsafe fn create_pipeline(&mut self) -> Result<()>
pub unsafe fn create_pipeline(&mut self) -> Result<()>
Creates a pipeline after parameter and weight loading.
§Safety
Required parameters and weights must be loaded according to the layer contract.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Layer
impl !RefUnwindSafe for Layer
impl !Send for Layer
impl !Sync for Layer
impl Unpin for Layer
impl UnsafeUnpin for Layer
impl UnwindSafe for Layer
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