Method
forward
(self, hidden_states: torch.Tensor)
Source from the content-addressed store, hash-verified
| 443 | self.eps = eps |
| 444 | |
| 445 | def forward(self, hidden_states: torch.Tensor): |
| 446 | input_dtype = hidden_states.dtype |
| 447 | variance = hidden_states.to(torch.float32).pow(2).mean(-1, keepdim=True) |
| 448 | hidden_states = hidden_states * torch.rsqrt(variance + self.eps) |
| 449 | |
| 450 | return (self.weight * hidden_states).to(input_dtype) |
| 451 | |
| 452 | |
| 453 | class CoreAttention(torch.nn.Module): |
Callers
nothing calls this directly
Tested by
no test coverage detected