pub struct LoraStack { /* private fields */ }Expand description
Every adapter attached to one base matrix, applied in order. Two
adapters on one weight are two terms of the sum, as they are in
llama.cpp’s for (const auto & lora : *loras).
Implementations§
Source§impl LoraStack
impl LoraStack
pub fn new(delta: LoraDelta) -> Self
pub fn push(&mut self, delta: LoraDelta)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn deltas(&self) -> &[LoraDelta]
pub fn resident_bytes(&self) -> usize
Sourcepub fn add_row_to(&self, r: usize, out_row: &mut [f32])
pub fn add_row_to(&self, r: usize, out_row: &mut [f32])
The delta of one row, for a row gather.
Sourcepub fn add_batch_to(&self, x_batch: &[f32], batch: usize, out: &mut [f32])
pub fn add_batch_to(&self, x_batch: &[f32], batch: usize, out: &mut [f32])
out[b] += Σ_i s_i · B_i (A_i x_b) over a [batch][cols] input.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoraStack
impl RefUnwindSafe for LoraStack
impl Send for LoraStack
impl Sync for LoraStack
impl Unpin for LoraStack
impl UnsafeUnpin for LoraStack
impl UnwindSafe for LoraStack
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