Mojo struct
MaskStrategy
struct MaskStrategy
Implemented traits
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime members
COMPUTED
comptime COMPUTED = MaskStrategy(SIMD(4))
Mask where the call operator must be used to compute the masked value.
LOWER_TRIANGULAR
comptime LOWER_TRIANGULAR = MaskStrategy(SIMD(1))
Masks above the diagonal, e.g. a CausalMask or a SlidingWindowCausalMask.
NO_MASK
comptime NO_MASK = MaskStrategy(SIMD(0))
No mask is to be applied.
OUT_OF_BOUNDS
comptime OUT_OF_BOUNDS = MaskStrategy(SIMD(8))
Check if we are out of bounds, e.g. at the end of a NullMask but unnecessary for a CausalMask.
UPPER_TRIANGULAR
comptime UPPER_TRIANGULAR = MaskStrategy(SIMD(2))
Masks below the diagonal, e.g. a SlidingWindowCausalMask.
Methods
__init__
__init__(value: Int32) -> Self
__init__(value: Int32, window_size: Int32) -> Self
__eq__
__ne__
__contains__
__and__
__and__(self, other: Self) -> Self
__or__
__or__(self, other: Self) -> Self
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!