Skip to main content

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__​

__eq__(self, other: Self) -> Bool

Returns:

Bool

__ne__​

__ne__(self, other: Self) -> Bool

Returns:

Bool

__contains__​

__contains__(self, other: Self) -> Bool

Returns:

Bool

__and__​

__and__(self, other: Self) -> Self

__or__​

__or__(self, other: Self) -> Self