pub struct BitNetAdapter { /* private fields */ }Expand description
BitNet adapter for peft-rs integration.
This adapter wraps a BitLinear layer and implements the peft-rs Adapter trait
(when the peft feature is enabled).
Implementations§
Source§impl BitNetAdapter
impl BitNetAdapter
Sourcepub fn new(layer: BitLinear, config: BitNetAdapterConfig) -> Self
pub fn new(layer: BitLinear, config: BitNetAdapterConfig) -> Self
Create a new BitNet adapter from a BitLinear layer.
Sourcepub const fn config(&self) -> &BitNetAdapterConfig
pub const fn config(&self) -> &BitNetAdapterConfig
Get reference to the configuration.
Sourcepub fn num_parameters(&self) -> usize
pub fn num_parameters(&self) -> usize
Get the number of quantized parameters.
Sourcepub fn compression_ratio(&self) -> f32
pub fn compression_ratio(&self) -> f32
Get the compression ratio.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BitNetAdapter
impl !RefUnwindSafe for BitNetAdapter
impl Send for BitNetAdapter
impl Sync for BitNetAdapter
impl Unpin for BitNetAdapter
impl !UnwindSafe for BitNetAdapter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more