mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
fp8 weight support for Stable Cascade.
This commit is contained in:
parent
f8706546f3
commit
11e3221f1f
@ -84,7 +84,7 @@ class GlobalResponseNorm(nn.Module):
|
|||||||
def forward(self, x):
|
def forward(self, x):
|
||||||
Gx = torch.norm(x, p=2, dim=(1, 2), keepdim=True)
|
Gx = torch.norm(x, p=2, dim=(1, 2), keepdim=True)
|
||||||
Nx = Gx / (Gx.mean(dim=-1, keepdim=True) + 1e-6)
|
Nx = Gx / (Gx.mean(dim=-1, keepdim=True) + 1e-6)
|
||||||
return self.gamma.to(x.device) * (x * Nx) + self.beta.to(x.device) + x
|
return self.gamma.to(device=x.device, dtype=x.dtype) * (x * Nx) + self.beta.to(device=x.device, dtype=x.dtype) + x
|
||||||
|
|
||||||
|
|
||||||
class ResBlock(nn.Module):
|
class ResBlock(nn.Module):
|
||||||
|
Loading…
Reference in New Issue
Block a user