MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / rms_norm

Function rms_norm

diffsynth/models/stepvideo_vae.py:871–876  ·  view source on GitHub ↗
(input, normalized_shape, eps=1e-6)

Source from the content-addressed store, hash-verified

869
870
871def rms_norm(input, normalized_shape, eps=1e-6):
872 dtype = input.dtype
873 input = input.to(torch.float32)
874 variance = input.pow(2).flatten(-len(normalized_shape)).mean(-1)[(...,) + (None,) * len(normalized_shape)]
875 input = input * torch.rsqrt(variance + eps)
876 return input.to(dtype)
877
878class DiagonalGaussianDistribution(object):
879 def __init__(self, parameters, deterministic=False, rms_norm_mean=False, only_return_mean=False):

Callers 1

__init__Method · 0.85

Calls 1

toMethod · 0.45

Tested by

no test coverage detected