Python function
causal_attention_mask
causal_attention_mask()
max.pipelines.modeling.dataprocessing.causal_attention_mask(original_start_pos, original_seq_len)
Builds a causal attention mask for a batch of variable-length sequences.
-
Parameters:
-
Returns:
-
Float32 mask array where visible positions are 0 and masked positions are a large negative value (so that softmax treats them as -inf).
-
Return type:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!