MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / __init__

Method __init__

k_diffusion/models/modules.py:533–537  ·  view source on GitHub ↗
(self, d_model, d_ff, d_head, cond_features, window_size, index, dropout=0.0)

Source from the content-addressed store, hash-verified

531
532class ShiftedWindowTransformerLayer(nn.Module):
533 def __init__(self, d_model, d_ff, d_head, cond_features, window_size, index, dropout=0.0):
534 super().__init__()
535 window_shift = window_size // 2 if index % 2 == 1 else 0
536 self.self_attn = ShiftedWindowSelfAttentionBlock(d_model, d_head, cond_features, window_size, window_shift, dropout=dropout)
537 self.ff = FeedForwardBlock(d_model, d_ff, cond_features, dropout=dropout)
538
539 def forward(self, x, pos, cond):
540 x = checkpoint(self.self_attn, x, pos, cond)

Callers

nothing calls this directly

Calls 3

FeedForwardBlockClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected