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

Method __init__

k_diffusion/models/modules.py:598–602  ·  view source on GitHub ↗
(self, in_features, out_features, patch_size=(2, 2))

Source from the content-addressed store, hash-verified

596
597class TokenMerge(nn.Module):
598 def __init__(self, in_features, out_features, patch_size=(2, 2)):
599 super().__init__()
600 self.h = patch_size[0]
601 self.w = patch_size[1]
602 self.proj = apply_wd(Linear(in_features * self.h * self.w, out_features, bias=False))
603
604 def forward(self, x):
605 x = rearrange(x, "... (h nh) (w nw) e -> ... h w (nh nw e)", nh=self.h, nw=self.w)

Callers

nothing calls this directly

Calls 3

apply_wdFunction · 0.85
LinearClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected