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

Method patch_tgrow_layers

examples/WanVSR/utils/TCDecoder.py:244–252  ·  view source on GitHub ↗

Patch TGrow layers to use a smaller kernel if needed (decoder-only).

(self, sd)

Source from the content-addressed store, hash-verified

242 return nn.Sequential(*new_layers)
243
244 def patch_tgrow_layers(self, sd):
245 """Patch TGrow layers to use a smaller kernel if needed (decoder-only)."""
246 new_sd = self.state_dict()
247 for i, layer in enumerate(self.decoder):
248 if isinstance(layer, TGrow):
249 key = f"decoder.{i}.conv.weight"
250 if key in sd and sd[key].shape[0] > new_sd[key].shape[0]:
251 sd[key] = sd[key][-new_sd[key].shape[0]:]
252 return sd
253
254 def decode_video(self, x, parallel=True, show_progress_bar=False, cond=None):
255 """Decode a sequence of frames from latents.

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected