pub struct LlamaStateSeqFlags(/* private fields */);Expand description
Flags for state sequence operations.
These flags control what parts of the state are included when saving/restoring sequence state.
Implementations§
Source§impl LlamaStateSeqFlags
impl LlamaStateSeqFlags
Sourcepub const PARTIAL_ONLY: LlamaStateSeqFlags
pub const PARTIAL_ONLY: LlamaStateSeqFlags
Work only with partial states, such as SWA KV cache or recurrent cache (e.g. Mamba).
This flag is useful when you only want to save/restore the recurrent state without affecting the KV cache.
Sourcepub const ON_DEVICE: LlamaStateSeqFlags
pub const ON_DEVICE: LlamaStateSeqFlags
Keep the copied data on device (GPU) memory rather than host.
Getting the state for a seq_id with this flag invalidates all
prior states obtained for that seq_id with this flag set.
Sourcepub const fn empty() -> LlamaStateSeqFlags
pub const fn empty() -> LlamaStateSeqFlags
Create an empty flags set.
Sourcepub const fn from_bits(bits: u32) -> LlamaStateSeqFlags
pub const fn from_bits(bits: u32) -> LlamaStateSeqFlags
Construct from raw bits.
Sourcepub const fn contains(&self, other: LlamaStateSeqFlags) -> bool
pub const fn contains(&self, other: LlamaStateSeqFlags) -> bool
Check if a flag is set.
Trait Implementations§
Source§impl BitOr for LlamaStateSeqFlags
impl BitOr for LlamaStateSeqFlags
Source§impl Clone for LlamaStateSeqFlags
impl Clone for LlamaStateSeqFlags
Source§fn clone(&self) -> LlamaStateSeqFlags
fn clone(&self) -> LlamaStateSeqFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LlamaStateSeqFlags
Source§impl Debug for LlamaStateSeqFlags
impl Debug for LlamaStateSeqFlags
Source§impl Default for LlamaStateSeqFlags
impl Default for LlamaStateSeqFlags
impl Eq for LlamaStateSeqFlags
Source§impl PartialEq for LlamaStateSeqFlags
impl PartialEq for LlamaStateSeqFlags
impl StructuralPartialEq for LlamaStateSeqFlags
Auto Trait Implementations§
impl Freeze for LlamaStateSeqFlags
impl RefUnwindSafe for LlamaStateSeqFlags
impl Send for LlamaStateSeqFlags
impl Sync for LlamaStateSeqFlags
impl Unpin for LlamaStateSeqFlags
impl UnsafeUnpin for LlamaStateSeqFlags
impl UnwindSafe for LlamaStateSeqFlags
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