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

Method init_weight2

wan/modules/vae.py:174–183  ·  view source on GitHub ↗
(self, conv)

Source from the content-addressed store, hash-verified

172 nn.init.zeros_(conv.bias.data)
173
174 def init_weight2(self, conv):
175 conv_weight = conv.weight.data
176 nn.init.zeros_(conv_weight)
177 c1, c2, t, h, w = conv_weight.size()
178 init_matrix = torch.eye(c1 // 2, c2)
179 #init_matrix = repeat(init_matrix, 'o ... -> (o 2) ...').permute(1,0,2).contiguous().reshape(c1,c2)
180 conv_weight[:c1 // 2, :, -1, 0, 0] = init_matrix
181 conv_weight[c1 // 2:, :, -1, 0, 0] = init_matrix
182 conv.weight.data.copy_(conv_weight)
183 nn.init.zeros_(conv.bias.data)
184
185
186class ResidualBlock(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected