(self, layer_id: int, attn_start: int | None = None, local_end: int | None = None)
| 102 | return slots |
| 103 | |
| 104 | def k_cache(self, layer_id: int, attn_start: int | None = None, local_end: int | None = None) -> torch.Tensor: |
| 105 | valid = self._valid_slots(layer_id) |
| 106 | if attn_start is not None or local_end is not None: |
| 107 | attn_start = 0 if attn_start is None else int(attn_start) |
| 108 | local_end = valid.numel() if local_end is None else int(local_end) |
| 109 | valid = valid[attn_start:local_end] |
| 110 | return self._k_buffer[layer_id, valid] |
| 111 | |
| 112 | def v_cache(self, layer_id: int, attn_start: int | None = None, local_end: int | None = None) -> torch.Tensor: |
| 113 | valid = self._valid_slots(layer_id) |
nothing calls this directly
no test coverage detected