[Spec][Ngram] Clean up unused stateless batchMatch (#22487)

This commit is contained in:
Khoa Pham
2026-04-10 21:52:56 -07:00
committed by GitHub
parent 04bd8e1218
commit aeeff58cd4
4 changed files with 0 additions and 67 deletions
-17
View File
@@ -74,23 +74,6 @@ def get_ngram_corpus_cls():
tokens_flat, offsets = _to_csr(batch_tokens)
self.async_insert(tokens_flat, offsets) # type: ignore
def match(
self,
batch_tokens: List[List[int]],
) -> Tuple[np.ndarray, np.ndarray]:
tokens_flat, offsets = _to_csr(batch_tokens)
batch_size = len(batch_tokens)
d = self._draft_token_num
out_tokens = torch.zeros(batch_size * d, dtype=torch.int32)
out_mask = torch.zeros(batch_size * d * d, dtype=torch.uint8)
self.batch_match(tokens_flat, offsets, out_tokens, out_mask) # type: ignore
return out_tokens.numpy().astype(np.int64), out_mask.numpy().astype(
np.int64
)
def match_stateful(
self,
state_ids: List[int],