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

Method forward

bitnet/bit_transformer.py:82–88  ·  view source on GitHub ↗
(self, x: Tensor, *args, **kwargs)

Source from the content-addressed store, hash-verified

80 self.norm = nn.LayerNorm(dim)
81
82 def forward(self, x: Tensor, *args, **kwargs) -> Tensor:
83 skip = x
84 for attn, ffn in zip(self.layers, self.ffn_layers):
85 x, _ = attn(x, x, x, is_causal=True, *args, **kwargs)
86 x = self.norm(x + skip)
87 x = ffn(x) + x
88 return x
89
90
91# [MAIN MODEL] BitNetTransformer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected