Skip to main content

Mojo struct

Pack

@register_passable(trivial) struct Pack[MaskType: MHAMask, ScoreModType: ScoreModTrait, SchedulerType: MHATileScheduler, ValidLengthType: OptionalPointer, SinkType: OptionalPointer, KVRowOffsetsType: OptionalPointer, MaxSeqLenType: OptionallyStaticInt, PartitionType: MHAPartitionScheme]

Fields

  • mask (MaskType):
  • score_mod (ScoreModType):
  • scheduler (SchedulerType):
  • valid_length (ValidLengthType):
  • sink_weights (SinkType):
  • kv_input_row_offsets (KVRowOffsetsType):
  • max_seq_len (MaxSeqLenType):
  • partition (PartitionType):

Implemented traits

AnyType, Copyable, DevicePassable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable

comptime members

__copy_ctor_is_trivial

comptime __copy_ctor_is_trivial = (((((((MaskType.__copy_ctor_is_trivial & ScoreModType.__copy_ctor_is_trivial) & SchedulerType.__copy_ctor_is_trivial) & ValidLengthType.__copy_ctor_is_trivial) & SinkType.__copy_ctor_is_trivial) & KVRowOffsetsType.__copy_ctor_is_trivial) & MaxSeqLenType.__copy_ctor_is_trivial) & PartitionType.__copy_ctor_is_trivial)

__del__is_trivial

comptime __del__is_trivial = (((((((MaskType.__del__is_trivial & ScoreModType.__del__is_trivial) & SchedulerType.__del__is_trivial) & ValidLengthType.__del__is_trivial) & SinkType.__del__is_trivial) & KVRowOffsetsType.__del__is_trivial) & MaxSeqLenType.__del__is_trivial) & PartitionType.__del__is_trivial)

__move_ctor_is_trivial

comptime __move_ctor_is_trivial = (((((((MaskType.__move_ctor_is_trivial & ScoreModType.__move_ctor_is_trivial) & SchedulerType.__move_ctor_is_trivial) & ValidLengthType.__move_ctor_is_trivial) & SinkType.__move_ctor_is_trivial) & KVRowOffsetsType.__move_ctor_is_trivial) & MaxSeqLenType.__move_ctor_is_trivial) & PartitionType.__move_ctor_is_trivial)

device_type

comptime device_type = Pack[MaskType, ScoreModType, SchedulerType, ValidLengthType, SinkType, KVRowOffsetsType, MaxSeqLenType, PartitionType]

Methods

__init__

__init__(mask: MaskType, score_mod: ScoreModType, scheduler: SchedulerType, valid_length: ValidLengthType, sink_weights: SinkType, kv_input_row_offsets: KVRowOffsetsType, max_seq_len: MaxSeqLenType, partition: PartitionType) -> Self

get_type_name

static get_type_name() -> String

Returns:

String

Was this page helpful?