Method
forward
(
self,
x: torch.Tensor,
cache: LayerCache,
attn_bias: AttnBias,
)
Source from the content-addressed store, hash-verified
| 229 | self.ffn_norm = RMSNorm(args.dim, eps=args.norm_eps) |
| 230 | |
| 231 | def forward( |
| 232 | self, |
| 233 | x: torch.Tensor, |
| 234 | cache: LayerCache, |
| 235 | attn_bias: AttnBias, |
| 236 | ) -> torch.Tensor: |
| 237 | h = x + self.attention.forward( |
| 238 | self.attention_norm(x), |
| 239 | cache, |
| 240 | attn_bias, |
| 241 | ) |
| 242 | out = h + self.feed_forward(self.ffn_norm(h)) |
| 243 | return out |
| 244 | |
| 245 | |
| 246 | class Transformer(nn.Module): |
Callers
nothing calls this directly
Tested by
no test coverage detected