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

Method forward

examples/WanVSR/utils/utils.py:41–52  ·  view source on GitHub ↗
(self, x, cache_x=None)

Source from the content-addressed store, hash-verified

39 self.padding = (0, 0, 0)
40
41 def forward(self, x, cache_x=None):
42 padding = list(self._padding)
43 if cache_x is not None and self._padding[4] > 0:
44 cache_x = cache_x.to(x.device)
45 # print(cache_x.shape, x.shape)
46 x = torch.cat([cache_x, x], dim=2)
47 padding[4] -= cache_x.shape[2]
48 # print('cache!')
49 x = F.pad(x, padding, mode='replicate') # mode='replicate'
50 # print(x[0,0,:,0,0])
51
52 return super().forward(x)
53
54class PixelShuffle3d(nn.Module):
55 def __init__(self, ff, hh, ww):

Callers

nothing calls this directly

Calls 2

toMethod · 0.45
forwardMethod · 0.45

Tested by

no test coverage detected