pub struct QLoRALinear { /* private fields */ }Expand description
QLoRA layer with quantized base weights
Implementations§
Source§impl QLoRALinear
impl QLoRALinear
Sourcepub fn new(in_features: usize, out_features: usize, config: QLoRAConfig) -> Self
pub fn new(in_features: usize, out_features: usize, config: QLoRAConfig) -> Self
Create new QLoRA linear layer
Sourcepub fn lora_parameters(&self) -> Vec<Tensor>
pub fn lora_parameters(&self) -> Vec<Tensor>
Get LoRA parameters
Sourcepub fn memory_savings_ratio(&self) -> f32
pub fn memory_savings_ratio(&self) -> f32
Get memory savings compared to full fine-tuning
Auto Trait Implementations§
impl Freeze for QLoRALinear
impl !RefUnwindSafe for QLoRALinear
impl Send for QLoRALinear
impl Sync for QLoRALinear
impl Unpin for QLoRALinear
impl !UnwindSafe for QLoRALinear
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> 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