(
self,
token_values: torch.Tensor,
token_lengths: torch.Tensor,
start_pos: torch.Tensor,
cache: list[LayerCache],
kv_padding: int,
)
| 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 | |
| 299 | def make_cache( |
nothing calls this directly
no test coverage detected