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

Method init_weight

wan/models/wan_vae.py:166–176  ·  view source on GitHub ↗
(self, conv)

Source from the content-addressed store, hash-verified

164 return x
165
166 def init_weight(self, conv):
167 conv_weight = conv.weight
168 nn.init.zeros_(conv_weight)
169 c1, c2, t, h, w = conv_weight.size()
170 one_matrix = torch.eye(c1, c2)
171 init_matrix = one_matrix
172 nn.init.zeros_(conv_weight)
173 #conv_weight.data[:,:,-1,1,1] = init_matrix * 0.5
174 conv_weight.data[:, :, 1, 0, 0] = init_matrix #* 0.5
175 conv.weight.data.copy_(conv_weight)
176 nn.init.zeros_(conv.bias.data)
177
178 def init_weight2(self, conv):
179 conv_weight = conv.weight.data

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected