MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / forward

Method forward

inference/models/llama.py:250–261  ·  view source on GitHub ↗
(
        self,
        x: torch.Tensor,
        start_pos: int,
        freqs_cis: torch.Tensor,
        mask: Optional[torch.Tensor],
    )

Source from the content-addressed store, hash-verified

248 self.post_attention_layernorm = RMSNorm(args.hidden_size, eps=args.rms_norm_eps)
249
250 def forward(
251 self,
252 x: torch.Tensor,
253 start_pos: int,
254 freqs_cis: torch.Tensor,
255 mask: Optional[torch.Tensor],
256 ):
257 h = x + self.self_attn.forward(
258 self.input_layernorm(x), start_pos, freqs_cis, mask
259 )
260 out = h + self.mlp.forward(self.post_attention_layernorm(h))
261 return out
262
263
264class Transformer(nn.Module):

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected