lmflow.utils.flash_attention.gpt2_flash_attention#
Functions#
|
|
|
|
Module Contents#
- lmflow.utils.flash_attention.gpt2_flash_attention.forward(self, hidden_states: Tuple[torch.FloatTensor] | None, layer_past: Tuple[torch.Tensor] | None = None, attention_mask: torch.FloatTensor | None = None, head_mask: torch.FloatTensor | None = None, encoder_hidden_states: torch.Tensor | None = None, encoder_attention_mask: torch.FloatTensor | None = None, use_cache: bool | None = False, output_attentions: bool | None = False) Tuple[torch.Tensor | Tuple[torch.Tensor], Ellipsis] [source]#