pub enum MaskTile<F: Float> {
Materialized(MaterializedTileMask<F>),
Logical(LogicalTileMask),
}Expand description
Mask tile for Tile Attention. It is an additive mask: the result of apply
should be added, not multiplied.
Variants§
Materialized(MaterializedTileMask<F>)
When a mask tensor is supplied. Also contains a logical part.
Logical(LogicalTileMask)
When no mask tensor is supplied. Used for out-of-bounds and causal mask.
Implementations§
Source§impl<F: Float> MaskTile<F>
impl<F: Float> MaskTile<F>
pub fn new_Materialized(_0: MaterializedTileMask<F>) -> Self
pub fn __expand_new_Materialized( _: &mut Scope, _0: <MaterializedTileMask<F> as RudaType>::ExpandType, ) -> MaskTileExpand<F>
pub fn new_Logical(_0: LogicalTileMask) -> Self
pub fn __expand_new_Logical( _: &mut Scope, _0: <LogicalTileMask as RudaType>::ExpandType, ) -> MaskTileExpand<F>
Source§impl<F: Float> MaskTile<F>
impl<F: Float> MaskTile<F>
pub fn new( out_of_bounds: ComptimeOption<Coords2d>, config: MaskConfig, ) -> MaskTile<F>
Sourcepub fn update<E: Numeric, ES: Size>(
&mut self,
new_origin: Coords2d,
tile: ComptimeOption<StridedTile<E, ES>>,
)
pub fn update<E: Numeric, ES: Size>( &mut self, new_origin: Coords2d, tile: ComptimeOption<StridedTile<E, ES>>, )
Loads the mask data into the fragment if a tile is given; otherwise only updates the logical mask’s origin.
pub fn __expand_new( scope: &mut Scope, out_of_bounds: <ComptimeOption<Coords2d> as RudaType>::ExpandType, config: MaskConfig, ) -> <MaskTile<F> as RudaType>::ExpandType
pub fn __expand_update<E: Numeric, ES: Size>( scope: &mut Scope, this: <Self as RudaType>::ExpandType, new_origin: <Coords2d as RudaType>::ExpandType, tile: <ComptimeOption<StridedTile<E, ES>> as RudaType>::ExpandType, ) -> <() as RudaType>::ExpandType
Trait Implementations§
Source§impl<F: Float> Mask for MaskTile<F>
impl<F: Float> Mask for MaskTile<F>
fn should_mask(&self, local_pos: Coords2d) -> bool
fn __expand_should_mask( scope: &mut Scope, this: Self::ExpandType, local_pos: <(u32, u32) as RudaType>::ExpandType, ) -> <bool as RudaType>::ExpandType
Source§impl<F: Float> RudaDebug for MaskTile<F>
impl<F: Float> RudaDebug for MaskTile<F>
Source§fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
fn set_debug_name(&self, scope: &mut Scope, name: &'static str)
Set the debug name of this type’s expansion. Should do nothing for types that don’t appear
at runtime
Source§impl<F: Float> RudaType for MaskTile<F>
impl<F: Float> RudaType for MaskTile<F>
type ExpandType = MaskTileExpand<F>
Auto Trait Implementations§
impl<F> Freeze for MaskTile<F>where
MaterializedTileMask<F>: Freeze,
impl<F> RefUnwindSafe for MaskTile<F>where
MaterializedTileMask<F>: RefUnwindSafe,
impl<F> Send for MaskTile<F>where
MaterializedTileMask<F>: Send,
impl<F> Sync for MaskTile<F>where
MaterializedTileMask<F>: Sync,
impl<F> Unpin for MaskTile<F>where
MaterializedTileMask<F>: Unpin,
impl<F> UnsafeUnpin for MaskTile<F>where
MaterializedTileMask<F>: UnsafeUnpin,
impl<F> UnwindSafe for MaskTile<F>where
MaterializedTileMask<F>: UnwindSafe,
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