MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / layernorm_ref

Function layernorm_ref

reference.py:20–23  ·  view source on GitHub ↗

Layer normalization over last dimension.

(x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, eps: float = 1e-5)

Source from the content-addressed store, hash-verified

18
19# Layer Normalization
20def layernorm_ref(x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, eps: float = 1e-5) -> torch.Tensor:
21 """Layer normalization over last dimension."""
22 normalized_shape = x.shape[-1:]
23 return F.layer_norm(x, normalized_shape, weight, bias, eps)
24
25# RMS Normalization
26def rmsnorm_ref(x: torch.Tensor, weight: torch.Tensor, eps: float = 1e-6) -> torch.Tensor:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected