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

Method patchify

diffsynth/models/wan_video_dit.py:580–584  ·  view source on GitHub ↗
(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

578 self._cross_kv_initialized = True
579
580 def patchify(self, x: torch.Tensor):
581 x = self.patch_embedding(x)
582 grid_size = x.shape[2:]
583 x = rearrange(x, 'b c f h w -> b (f h w) c').contiguous()
584 return x, grid_size # x, grid_size: (f, h, w)
585
586 def unpatchify(self, x: torch.Tensor, grid_size: torch.Tensor):
587 return rearrange(

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected