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

Method forward

gpu/model.py:283–296  ·  view source on GitHub ↗
(
        self,
        token_values: torch.Tensor,
        token_lengths: torch.Tensor,
        start_pos: torch.Tensor,
        cache: list[LayerCache],
        kv_padding: int,
    )

Source from the content-addressed store, hash-verified

281 return logits.float()
282
283 def forward(
284 self,
285 token_values: torch.Tensor,
286 token_lengths: torch.Tensor,
287 start_pos: torch.Tensor,
288 cache: list[LayerCache],
289 kv_padding: int,
290 ) -> torch.Tensor:
291 attn_bias = AttnBias.from_seqlens(
292 q_seqlen=token_lengths.tolist(),
293 kv_seqlen=(start_pos + token_lengths).tolist(),
294 kv_padding=kv_padding,
295 )
296 return self.forward_with_attn_bias(token_values, attn_bias, cache)
297
298
299def make_cache(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected