MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / _norm

Method _norm

inference/models/llama.py:29–30  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

27 self.weight = nn.Parameter(torch.ones(dim))
28
29 def _norm(self, x):
30 return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)
31
32 def forward(self, x):
33 output = torch.empty_like(x)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected