MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / __init__

Method __init__

wan/models/wan_text_encoder.py:209–217  ·  view source on GitHub ↗
(self, num_buckets, num_heads, bidirectional, max_dist=128)

Source from the content-addressed store, hash-verified

207
208class T5RelativeEmbedding(nn.Module):
209 def __init__(self, num_buckets, num_heads, bidirectional, max_dist=128):
210 super(T5RelativeEmbedding, self).__init__()
211 self.num_buckets = num_buckets
212 self.num_heads = num_heads
213 self.bidirectional = bidirectional
214 self.max_dist = max_dist
215
216 # layers
217 self.embedding = nn.Embedding(num_buckets, num_heads)
218
219 def forward(self, lq, lk):
220 device = self.embedding.weight.device

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected