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

Method init_weight2

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

Source from the content-addressed store, hash-verified

186 nn.init.zeros_(conv.bias.data)
187
188 def init_weight2(self, conv):
189 conv_weight = conv.weight.data
190 nn.init.zeros_(conv_weight)
191 c1, c2, t, h, w = conv_weight.size()
192 init_matrix = torch.eye(c1 // 2, c2)
193 conv_weight[:c1 // 2, :, -1, 0, 0] = init_matrix
194 conv_weight[c1 // 2:, :, -1, 0, 0] = init_matrix
195 conv.weight.data.copy_(conv_weight)
196 nn.init.zeros_(conv.bias.data)
197
198
199class ResidualBlock(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected