pub struct SparseMask {
pub rows: Vec<usize>,
pub cols: Vec<usize>,
pub values: Option<Vec<f32>>,
}Expand description
Mask for sparse attention patterns.
Fields§
§rows: Vec<usize>Row indices for sparse mask
cols: Vec<usize>Column indices for sparse mask
values: Option<Vec<f32>>Optional values (if not provided, defaults to 1.0)
Trait Implementations§
Source§impl Clone for SparseMask
impl Clone for SparseMask
Source§fn clone(&self) -> SparseMask
fn clone(&self) -> SparseMask
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SparseMask
impl RefUnwindSafe for SparseMask
impl Send for SparseMask
impl Sync for SparseMask
impl Unpin for SparseMask
impl UnwindSafe for SparseMask
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