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

Method __init__

diffsynth/models/sd_text_encoder.py:6–14  ·  view source on GitHub ↗
(self, embed_dim, intermediate_size, num_heads=12, head_dim=64, use_quick_gelu=True)

Source from the content-addressed store, hash-verified

4
5class CLIPEncoderLayer(torch.nn.Module):
6 def __init__(self, embed_dim, intermediate_size, num_heads=12, head_dim=64, use_quick_gelu=True):
7 super().__init__()
8 self.attn = Attention(q_dim=embed_dim, num_heads=num_heads, head_dim=head_dim, bias_q=True, bias_kv=True, bias_out=True)
9 self.layer_norm1 = torch.nn.LayerNorm(embed_dim)
10 self.layer_norm2 = torch.nn.LayerNorm(embed_dim)
11 self.fc1 = torch.nn.Linear(embed_dim, intermediate_size)
12 self.fc2 = torch.nn.Linear(intermediate_size, embed_dim)
13
14 self.use_quick_gelu = use_quick_gelu
15
16 def quickGELU(self, x):
17 return x * torch.sigmoid(1.702 * x)

Callers

nothing calls this directly

Calls 2

AttentionClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected