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

Method forward

examples/WanVSR/utils/TCDecoder.py:79–89  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

77 self.hh = hh
78 self.ww = ww
79 def forward(self, x):
80 # x: (B, C, F, H, W)
81 B, C, F, H, W = x.shape
82 if F % self.ff != 0:
83 first_frame = x[:, :, 0:1, :, :].repeat(1, 1, self.ff - F % self.ff, 1, 1)
84 x = torch.cat([first_frame, x], dim=2)
85 return rearrange(
86 x,
87 'b c (f ff) (h hh) (w ww) -> b (c ff hh ww) f h w',
88 ff=self.ff, hh=self.hh, ww=self.ww
89 ).transpose(1, 2)
90
91# ----------------------------
92# Generic NTCHW graph executor (kept; used by decoder)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected