mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-07-16 05:26:58 +08:00
Merge 2ff056431df1fb3287aec3489da408263c0ffb31 into 519c9411653df99761053c30e101816e0ca3c24b
This commit is contained in:
commit
dda3151fd9
@ -9,4 +9,5 @@ class PixelNorm(nn.Module):
|
|||||||
self.eps = eps
|
self.eps = eps
|
||||||
|
|
||||||
def forward(self, x):
|
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…
x
Reference in New Issue
Block a user