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

Class CogPatchify

diffsynth/models/cog_dit.py:11–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class CogPatchify(torch.nn.Module):
12 def __init__(self, dim_in, dim_out, patch_size) -> None:
13 super().__init__()
14 self.proj = torch.nn.Conv3d(dim_in, dim_out, kernel_size=(1, patch_size, patch_size), stride=(1, patch_size, patch_size))
15
16 def forward(self, hidden_states):
17 hidden_states = self.proj(hidden_states)
18 hidden_states = rearrange(hidden_states, "B C T H W -> B (T H W) C")
19 return hidden_states
20
21
22

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected