MCPcopy Create free account
hub / github.com/microsoft/BitNet / forward

Method forward

gpu/model.py:231–243  ·  view source on GitHub ↗
(
        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
246class Transformer(nn.Module):

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected