Skip to main content

Mojo struct

MaskStrategy

@register_passable(trivial) struct MaskStrategy

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable

comptime members

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

COMPUTED

comptime COMPUTED = MaskStrategy(4)

Mask where the call operator must be used to compute the masked value.

LOWER_TRIANGULAR

comptime LOWER_TRIANGULAR = MaskStrategy(1)

Masks above the diagonal, e.g. a CausalMask or a SlidingWindowCausalMask.

NO_MASK

comptime NO_MASK = MaskStrategy(0)

No mask is to be applied.

OUT_OF_BOUNDS

comptime OUT_OF_BOUNDS = MaskStrategy(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(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

Was this page helpful?