pub struct KVCache {
pub k_cache: Vec<Arc<UnifiedTensor>>,
pub v_cache: Vec<Arc<UnifiedTensor>>,
pub max_seq_len: usize,
pub current_pos: usize,
}Expand description
KV-Cache for efficient autoregressive generation
Fields§
§k_cache: Vec<Arc<UnifiedTensor>>Cached keys for each layer
v_cache: Vec<Arc<UnifiedTensor>>Cached values for each layer
max_seq_len: usizeMaximum sequence length
current_pos: usizeCurrent position in cache
Auto Trait Implementations§
impl !RefUnwindSafe for KVCache
impl !UnwindSafe for KVCache
impl Freeze for KVCache
impl Send for KVCache
impl Sync for KVCache
impl Unpin for KVCache
impl UnsafeUnpin for KVCache
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