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

Method __init__

examples/WanVSR/utils/utils.py:15–23  ·  view source on GitHub ↗
(self, dim, channel_first=True, images=True, bias=False)

Source from the content-addressed store, hash-verified

13class RMS_norm(nn.Module):
14
15 def __init__(self, dim, channel_first=True, images=True, bias=False):
16 super().__init__()
17 broadcastable_dims = (1, 1, 1) if not images else (1, 1)
18 shape = (dim, *broadcastable_dims) if channel_first else (dim,)
19
20 self.channel_first = channel_first
21 self.scale = dim**0.5
22 self.gamma = nn.Parameter(torch.ones(shape))
23 self.bias = nn.Parameter(torch.zeros(shape)) if bias else 0.
24
25 def forward(self, x):
26 return F.normalize(

Callers 4

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected