mirror of
https://github.com/labmlai/annotated_deep_learning_paper_implementations.git
synced 2025-10-29 09:38:56 +08:00
fix
This commit is contained in:
@ -174,9 +174,9 @@ class CrossAttention(nn.Module):
|
||||
v = self.to_v(cond)
|
||||
|
||||
if CrossAttention.use_flash_attention and self.flash is not None and cond is None and self.d_head <= 128:
|
||||
self.flash_attention(q, k, v)
|
||||
return self.flash_attention(q, k, v)
|
||||
else:
|
||||
self.normal_attention(q, k, v)
|
||||
return self.normal_attention(q, k, v)
|
||||
|
||||
def flash_attention(self, q: torch.Tensor, k: torch.Tensor, v: torch.Tensor):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user