Return a copy of cache with [start, end) replaced by `real`.
(cache: DynamicCache, start: int, end: int, real: DynamicCache)
| 365 | |
| 366 | |
| 367 | def _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 | |
| 373 | def _select_indices(cache: DynamicCache, indices: torch.Tensor) -> DynamicCache: |
no test coverage detected