mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-30 16:20:17 +08:00
Update rmsnorm.py
This commit is contained in:
parent
9a25b80a20
commit
d934498f60
@ -12,10 +12,6 @@ except:
|
|||||||
|
|
||||||
|
|
||||||
def rms_norm(x, weight=None, eps=1e-6):
|
def rms_norm(x, weight=None, eps=1e-6):
|
||||||
|
|
||||||
if eps is None: # Ensure eps is not None
|
|
||||||
eps = 1e-6
|
|
||||||
|
|
||||||
if rms_norm_torch is not None and not (torch.jit.is_tracing() or torch.jit.is_scripting()):
|
if rms_norm_torch is not None and not (torch.jit.is_tracing() or torch.jit.is_scripting()):
|
||||||
if weight is None:
|
if weight is None:
|
||||||
return rms_norm_torch(x, (x.shape[-1],), eps=eps)
|
return rms_norm_torch(x, (x.shape[-1],), eps=eps)
|
||||||
@ -34,7 +30,7 @@ if RMSNorm is None:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
normalized_shape,
|
normalized_shape,
|
||||||
eps=1e-6, # Changed default from None to 1e-6
|
eps=1e-6,
|
||||||
elementwise_affine=True,
|
elementwise_affine=True,
|
||||||
device=None,
|
device=None,
|
||||||
dtype=None,
|
dtype=None,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user