MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / forward

Method forward

deepspeed/module_inject/layers.py:2505–2511  ·  view source on GitHub ↗
(self, hidden_states)

Source from the content-addressed store, hash-verified

2503 self.eps = eps
2504
2505 def forward(self, hidden_states):
2506 variance = hidden_states.to(torch.float32).pow(2).mean(-1, keepdim=True)
2507 hidden_states = hidden_states * torch.rsqrt(variance + self.eps)
2508 if self.weight.dtype in [torch.float16, torch.bfloat16]:
2509 hidden_states = hidden_states.to(self.weight.dtype)
2510
2511 return hidden_states * self.weight

Callers

nothing calls this directly

Calls 2

meanMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected