MCPcopy Create free account
hub / github.com/csuhan/OneLLM / forward

Method forward

model/components.py:41–53  ·  view source on GitHub ↗

Forward pass through the RMSNorm layer. Args: x (torch.Tensor): The input tensor. Returns: torch.Tensor: The output tensor after applying RMSNorm.

(self, x)

Source from the content-addressed store, hash-verified

39 return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)
40
41 def forward(self, x):
42 """
43 Forward pass through the RMSNorm layer.
44
45 Args:
46 x (torch.Tensor): The input tensor.
47
48 Returns:
49 torch.Tensor: The output tensor after applying RMSNorm.
50
51 """
52 output = self._norm(x.float()).type_as(x)
53 return output * self.weight
54
55
56

Callers

nothing calls this directly

Calls 1

_normMethod · 0.95

Tested by

no test coverage detected