MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / MemBlock

Class MemBlock

wan/models/wan_vae_tiny.py:22–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21
22class MemBlock(nn.Module):
23 def __init__(self, n_in, n_out, act_func):
24 super().__init__()
25 self.conv = nn.Sequential(conv(n_in * 2, n_out), act_func, conv(n_out, n_out), act_func, conv(n_out, n_out))
26 self.skip = nn.Conv2d(n_in, n_out, 1, bias=False) if n_in != n_out else nn.Identity()
27 self.act = act_func
28
29 def forward(self, x, past):
30 return self.act(self.conv(torch.cat([x, past], 1)) + self.skip(x))
31
32
33class TPool(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected