pub struct StridedMask {
pub batch_size: usize,
pub stride: usize,
}Expand description
Strided attention mask
Attends to every k-th position (used in Sparse Transformers).
Fields§
§batch_size: usizeBatch size
stride: usizeStride length
Implementations§
Trait Implementations§
Source§impl AttentionMask for StridedMask
impl AttentionMask for StridedMask
Source§impl Clone for StridedMask
impl Clone for StridedMask
Source§fn clone(&self) -> StridedMask
fn clone(&self) -> StridedMask
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 StridedMask
impl RefUnwindSafe for StridedMask
impl Send for StridedMask
impl Sync for StridedMask
impl Unpin for StridedMask
impl UnwindSafe for StridedMask
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