MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / AttentionModule

Class AttentionModule

diffsynth/models/wan_video_dit.py:290–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288
289
290class AttentionModule(nn.Module):
291 def __init__(self, num_heads):
292 super().__init__()
293 self.num_heads = num_heads
294
295 def forward(self, q, k, v, attention_mask=None):
296 x = flash_attention(q=q, k=k, v=v, num_heads=self.num_heads, attention_mask=attention_mask)
297 return x
298
299
300class SelfAttention(nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected