Mojo struct
MaterializedMask
@register_passable(trivial)
struct MaterializedMask[dtype_: DType, layout_: Layout]
Mask that's backed by a materialized tensor.
Fields
- mask_tensor (
LayoutTensor[dtype_, layout_, MutAnyOrigin]): - start_pos (
OptionalReg[LayoutTensor[DType.uint32, Layout.row_major(-1), MutAnyOrigin]]): - is_multiple_of_2 (
Bool):
Implemented traits
AnyType,
Copyable,
DevicePassable,
ImplicitlyCopyable,
MHAMask,
Movable,
UnknownDestructibility
Aliases
__copyinit__is_trivial
comptime __copyinit__is_trivial = True
__del__is_trivial
comptime __del__is_trivial = True
__moveinit__is_trivial
comptime __moveinit__is_trivial = True
apply_log2e_after_mask
comptime apply_log2e_after_mask = True
check_mask_during_decoding
comptime check_mask_during_decoding = True
device_type
comptime device_type = MaterializedMask[dtype_, layout_]
mask_out_of_bound
comptime mask_out_of_bound = True
mask_safe_out_of_bounds
comptime mask_safe_out_of_bounds = False
MaskType
comptime MaskType = LayoutTensor[dtype_, layout_, MutAnyOrigin]
Methods
__init__
__init__(mask_tensor: LayoutTensor[dtype_, layout_, MutAnyOrigin], start_pos: OptionalReg[LayoutTensor[DType.uint32, Layout.row_major(-1), MutAnyOrigin]] = None) -> Self
get_type_name
get_device_type_name
get_start_pos
mask
mask[dtype: DType, width: Int, //, *, element_type: DType = DType.uint32](self, coord: IndexList[4, element_type=element_type], score_vec: SIMD[dtype, width]) -> SIMD[dtype, width]
Returns:
status
status[*, element_type: DType = DType.uint32](self, tile_offset: IndexList[2, element_type=element_type], tile_size: IndexList[2, element_type=element_type]) -> TileMaskStatus
Returns:
TileMaskStatus
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!