| 248 | |
| 249 | |
| 250 | class WanLayerNorm(nn.LayerNorm): |
| 251 | |
| 252 | def __init__(self, dim, eps=1e-6, elementwise_affine=False): |
| 253 | super().__init__(dim, elementwise_affine=elementwise_affine, eps=eps) |
| 254 | |
| 255 | def forward(self, x): |
| 256 | return super().forward(x.float()).type_as(x) |
| 257 | |
| 258 | |
| 259 | class WanSelfAttention(nn.Module): |