ttnn.kv_cache.update_cache_for_token_
- ttnn.kv_cache.update_cache_for_token_(cache: ttnn.Tensor, input: ttnn.Tensor, update_index: int, batch_offset: int) ttnn.Tensor
-
Updates the
cachetensor in-place with values frominputatupdate_indexandbatch_offset.- Parameters:
-
cache (ttnn.Tensor)the cache tensor to be written to.
input (ttnn.Tensor)the token tensor to be written to the cache.
update_index (int)the cache sequence position, less than
cache.padded_shape[-2].batch_offset (int)the batch_offset into the cache tensor.
- Returns:
-
ttnn.Tensorthe output tensor.