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

Method __init__

diffsynth/models/sd3_dit.py:295–307  ·  view source on GitHub ↗
(self, dim, num_attention_heads, use_rms_norm=False)

Source from the content-addressed store, hash-verified

293
294class JointTransformerFinalBlock(torch.nn.Module):
295 def __init__(self, dim, num_attention_heads, use_rms_norm=False):
296 super().__init__()
297 self.norm1_a = AdaLayerNorm(dim)
298 self.norm1_b = AdaLayerNorm(dim, single=True)
299
300 self.attn = JointAttention(dim, dim, num_attention_heads, dim // num_attention_heads, only_out_a=True, use_rms_norm=use_rms_norm)
301
302 self.norm2_a = torch.nn.LayerNorm(dim, elementwise_affine=False, eps=1e-6)
303 self.ff_a = torch.nn.Sequential(
304 torch.nn.Linear(dim, dim*4),
305 torch.nn.GELU(approximate="tanh"),
306 torch.nn.Linear(dim*4, dim)
307 )
308
309
310 def forward(self, hidden_states_a, hidden_states_b, temb):

Callers

nothing calls this directly

Calls 3

AdaLayerNormClass · 0.85
JointAttentionClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected