MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / init_weight

Method init_weight

diffsynth/models/wan_video_vae.py:177–186  ·  view source on GitHub ↗
(self, conv)

Source from the content-addressed store, hash-verified

175 return x
176
177 def init_weight(self, conv):
178 conv_weight = conv.weight
179 nn.init.zeros_(conv_weight)
180 c1, c2, t, h, w = conv_weight.size()
181 one_matrix = torch.eye(c1, c2)
182 init_matrix = one_matrix
183 nn.init.zeros_(conv_weight)
184 conv_weight.data[:, :, 1, 0, 0] = init_matrix
185 conv.weight.data.copy_(conv_weight)
186 nn.init.zeros_(conv.bias.data)
187
188 def init_weight2(self, conv):
189 conv_weight = conv.weight.data

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected