pub struct AttentionCache { /* private fields */ }Expand description
Caller-owned incremental-decode key/value cache for MultiHeadAttention.
Each MultiHeadAttention::step call appends one [B*H, 1, D/H] key/value pair and
attends over every cached position. The cache binds to the constructing
module instance; presenting it to another attention module fails closed.
Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AttentionCache
impl !Send for AttentionCache
impl !Sync for AttentionCache
impl !UnwindSafe for AttentionCache
impl Forget for AttentionCache
impl Freeze for AttentionCachewhere
*const RcInner<RefCell<RuntimeState>> is !null: Freeze,
PhantomData<RcInner<RefCell<RuntimeState>>>: Freeze,
*const RcInner<StorageInner> is !null: Freeze,
PhantomData<RcInner<StorageInner>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<usize>: Freeze,
*const RcInner<MatrixSemantic> is !null: Freeze,
PhantomData<RcInner<MatrixSemantic>>: Freeze,
PhantomData<Rc<()>>: Freeze,
impl Move for AttentionCache
impl Unpin for AttentionCache
impl UnsafeUnpin for AttentionCachewhere
*const RcInner<RefCell<RuntimeState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<RuntimeState>>>: UnsafeUnpin,
*const RcInner<StorageInner> is !null: UnsafeUnpin,
PhantomData<RcInner<StorageInner>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
*const RcInner<MatrixSemantic> is !null: UnsafeUnpin,
PhantomData<RcInner<MatrixSemantic>>: UnsafeUnpin,
PhantomData<Rc<()>>: UnsafeUnpin,
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