Method
__init__
(
self,
hidden_size,
time_embed_dim,
patch_size,
out_channels,
latent_width,
latent_height,
elementwise_affine,
compressed_num_frames,
)
Source from the content-addressed store, hash-verified
| 460 | |
| 461 | class FinalLayerMixin(BaseMixin): |
| 462 | def __init__( |
| 463 | self, |
| 464 | hidden_size, |
| 465 | time_embed_dim, |
| 466 | patch_size, |
| 467 | out_channels, |
| 468 | latent_width, |
| 469 | latent_height, |
| 470 | elementwise_affine, |
| 471 | compressed_num_frames, |
| 472 | ): |
| 473 | super().__init__() |
| 474 | self.hidden_size = hidden_size |
| 475 | self.patch_size = patch_size |
| 476 | self.out_channels = out_channels |
| 477 | self.norm_final = nn.LayerNorm(hidden_size, elementwise_affine=elementwise_affine, eps=1e-6) |
| 478 | self.linear = nn.Linear(hidden_size, patch_size * patch_size * out_channels, bias=True) |
| 479 | self.adaLN_modulation = nn.Sequential(nn.SiLU(), nn.Linear(time_embed_dim, 2 * hidden_size, bias=True)) |
| 480 | |
| 481 | self.spatial_length = latent_width * latent_height // patch_size**2 |
| 482 | self.latent_width = latent_width |
| 483 | self.latent_height = latent_height |
| 484 | self.compressed_num_frames = compressed_num_frames |
| 485 | |
| 486 | def separate_modulate( |
| 487 | self, |
Callers
nothing calls this directly
Tested by
no test coverage detected