(self, x, t_mod)
| 505 | self.modulation = nn.Parameter(torch.randn(1, 2, dim) / dim**0.5) |
| 506 | |
| 507 | def forward(self, x, t_mod): |
| 508 | shift, scale = (self.modulation.to(dtype=t_mod.dtype, device=t_mod.device) + t_mod).chunk(2, dim=1) |
| 509 | x = (self.head(self.norm(x) * (1 + scale) + shift)) |
| 510 | return x |
| 511 | |
| 512 | |
| 513 | # ---------------------------- |