MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / _replace_functional

Function _replace_functional

KVCOMM/llm/kvcomm_engine.py:367–370  ·  view source on GitHub ↗

Return a copy of cache with [start, end) replaced by `real`.

(cache: DynamicCache, start: int, end: int, real: DynamicCache)

Source from the content-addressed store, hash-verified

365
366
367def _replace_functional(cache: DynamicCache, start: int, end: int, real: DynamicCache) -> DynamicCache:
368 """Return a copy of cache with [start, end) replaced by `real`."""
369 copied = _copy_cache(cache)
370 return _replace_inplace(copied, start, end, real)
371
372
373def _select_indices(cache: DynamicCache, indices: torch.Tensor) -> DynamicCache:

Callers 1

Calls 2

_copy_cacheFunction · 0.85
_replace_inplaceFunction · 0.85

Tested by

no test coverage detected