mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-31 08:40:19 +08:00
Merge 2ff056431d into c4a14df9a3
This commit is contained in:
commit
9b1a7dd83a
@ -9,4 +9,5 @@ class PixelNorm(nn.Module):
|
||||
self.eps = eps
|
||||
|
||||
def forward(self, x):
|
||||
return x / torch.sqrt(torch.mean(x**2, dim=self.dim, keepdim=True) + self.eps)
|
||||
mean_square = torch.mean(x * x, dim=self.dim, keepdim=True) + self.eps
|
||||
return x * torch.rsqrt(mean_square)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user