MCPcopy Create free account
hub / github.com/MeiGen-AI/MultiTalk / __init__

Method __init__

wan/modules/attention.py:283–314  ·  view source on GitHub ↗
(
        self,
        dim: int,
        encoder_hidden_states_dim: int,
        num_heads: int,
        qkv_bias: bool,
        qk_norm: bool,
        norm_layer: nn.Module,
        attn_drop: float = 0.0,
        proj_drop: float = 0.0,
        eps: float = 1e-6,
        class_range: int = 24,
        class_interval: int = 4,
    )

Source from the content-addressed store, hash-verified

281
282class SingleStreamMutiAttention(SingleStreamAttention):
283 def __init__(
284 self,
285 dim: int,
286 encoder_hidden_states_dim: int,
287 num_heads: int,
288 qkv_bias: bool,
289 qk_norm: bool,
290 norm_layer: nn.Module,
291 attn_drop: float = 0.0,
292 proj_drop: float = 0.0,
293 eps: float = 1e-6,
294 class_range: int = 24,
295 class_interval: int = 4,
296 ) -> None:
297 super().__init__(
298 dim=dim,
299 encoder_hidden_states_dim=encoder_hidden_states_dim,
300 num_heads=num_heads,
301 qkv_bias=qkv_bias,
302 qk_norm=qk_norm,
303 norm_layer=norm_layer,
304 attn_drop=attn_drop,
305 proj_drop=proj_drop,
306 eps=eps,
307 )
308 self.class_interval = class_interval
309 self.class_range = class_range
310 self.rope_h1 = (0, self.class_interval)
311 self.rope_h2 = (self.class_range - self.class_interval, self.class_range)
312 self.rope_bak = int(self.class_range // 2)
313
314 self.rope_1d = RotaryPositionalEmbedding1D(self.head_dim)
315
316 def forward(self,
317 x: torch.Tensor,

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected