MCPcopy
hub / github.com/Wan-Video/Wan2.2 / init_weight2

Method init_weight2

wan/modules/vae2_2.py:182–190  ·  view source on GitHub ↗
(self, conv)

Source from the content-addressed store, hash-verified

180 nn.init.zeros_(conv.bias.data)
181
182 def init_weight2(self, conv):
183 conv_weight = conv.weight.data.detach().clone()
184 nn.init.zeros_(conv_weight)
185 c1, c2, t, h, w = conv_weight.size()
186 init_matrix = torch.eye(c1 // 2, c2)
187 conv_weight[:c1 // 2, :, -1, 0, 0] = init_matrix
188 conv_weight[c1 // 2:, :, -1, 0, 0] = init_matrix
189 conv.weight = nn.Parameter(conv_weight)
190 nn.init.zeros_(conv.bias.data)
191
192
193class ResidualBlock(nn.Module):

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected