espnet3.systems.f5tts.src.modules.MMDiTBlock
espnet3.systems.f5tts.src.modules.MMDiTBlock
class espnet3.systems.f5tts.src.modules.MMDiTBlock(dim, heads, dim_head, ff_mult=4, dropout=0.1, context_dim=None, context_pre_only=False, qk_norm=None, attn_backend='torch', attn_mask_enabled=False)
Bases: Module
modified from diffusers/src/diffusers/models/attention.py
notes. _c: context related. text, cond, etc. (left part in sd3 fig2.b) _x: noised input related. (right part) context_pre_only: last layer only do prenorm + modulation cuz no more ffn
Initialize internal Module state, shared by both nn.Module and ScriptModule.
forward(x, c, t, mask=None, rope=None, c_rope=None, c_mask=None)
Define the computation performed at every call.
Should be overridden by all subclasses.
NOTE
Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
