mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-10-28 18:04:34 +08:00
clamp input
This commit is contained in:
parent
9a616b81c1
commit
e21b688e72
@ -269,7 +269,7 @@ def fp8_linear(self, input):
|
|||||||
|
|
||||||
if scale_input is None:
|
if scale_input is None:
|
||||||
scale_input = torch.ones((), device=input.device, dtype=torch.float32)
|
scale_input = torch.ones((), device=input.device, dtype=torch.float32)
|
||||||
inn = input.reshape(-1, input.shape[2]).to(dtype)
|
inn = torch.clamp(input, min=-448, max=448).reshape(-1, input.shape[2]).to(dtype)
|
||||||
else:
|
else:
|
||||||
scale_input = scale_input.to(input.device)
|
scale_input = scale_input.to(input.device)
|
||||||
inn = (input * (1.0 / scale_input).to(input.dtype)).reshape(-1, input.shape[2]).to(dtype)
|
inn = (input * (1.0 / scale_input).to(input.dtype)).reshape(-1, input.shape[2]).to(dtype)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user