pub struct MaskBuilder { /* private fields */ }Expand description
Builder for attention masks
Implementations§
Source§impl MaskBuilder
impl MaskBuilder
Sourcepub fn pattern(self, pattern: MaskPattern) -> Self
pub fn pattern(self, pattern: MaskPattern) -> Self
Set mask pattern
Sourcepub fn min_active(self, min: usize) -> Self
pub fn min_active(self, min: usize) -> Self
Set minimum active heads
Sourcepub fn category_weights(self, weights: HashMap<HeadCategory, f32>) -> Self
pub fn category_weights(self, weights: HashMap<HeadCategory, f32>) -> Self
Set category weights for category-based masking
Sourcepub fn category_mapping(self, mapping: CategoryMapping) -> Self
pub fn category_mapping(self, mapping: CategoryMapping) -> Self
Set category mapping
Sourcepub fn build(self) -> AttentionMask
pub fn build(self) -> AttentionMask
Build the mask
Trait Implementations§
Source§impl Clone for MaskBuilder
impl Clone for MaskBuilder
Source§fn clone(&self) -> MaskBuilder
fn clone(&self) -> MaskBuilder
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 moreAuto Trait Implementations§
impl Freeze for MaskBuilder
impl RefUnwindSafe for MaskBuilder
impl Send for MaskBuilder
impl Sync for MaskBuilder
impl Unpin for MaskBuilder
impl UnsafeUnpin for MaskBuilder
impl UnwindSafe for MaskBuilder
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