MCPcopy Create free account
hub / github.com/AMAP-ML/Eevee / AttentionModule

Class AttentionModule

models/dit.py:137–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135
136
137class AttentionModule(nn.Module):
138 def __init__(self, num_heads):
139 super().__init__()
140 self.num_heads = num_heads
141
142 def forward(self, q, k, v):
143 x = flash_attention(q=q, k=k, v=v, num_heads=self.num_heads)
144 return x
145
146
147class SelfAttention(nn.Module):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected