Mojo struct
MaskStrategy
struct MaskStrategy
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDestructible,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime membersβ
COMPUTEDβ
comptime COMPUTED = MaskStrategy(Int32(4))
Mask where the call operator must be used to compute the masked value.
LOWER_TRIANGULARβ
comptime LOWER_TRIANGULAR = MaskStrategy(Int32(1))
Masks above the diagonal, e.g. a CausalMask or a SlidingWindowCausalMask.
NO_MASKβ
comptime NO_MASK = MaskStrategy(Int32(0))
No mask is to be applied.
OUT_OF_BOUNDSβ
comptime OUT_OF_BOUNDS = MaskStrategy(Int32(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(Int32(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!