MCPcopy Create free account
hub / github.com/pytorch/executorch / reset

Method reset

exir/tests/test_memory_planning.py:1362–1364  ·  view source on GitHub ↗
(self, k_zeros: torch.Tensor, v_zeros: torch.Tensor)

Source from the content-addressed store, hash-verified

1360 return (k_out + v_out).sum(dim=-1)
1361
1362 def reset(self, k_zeros: torch.Tensor, v_zeros: torch.Tensor) -> None:
1363 self.kv_cache.k_cache.copy_(k_zeros)
1364 self.kv_cache.v_cache.copy_(v_zeros)
1365
1366 model = KVCacheModel().eval()
1367 cache_shape = (1, 8, 2, 4) # [B, S, H, D]

Callers 3

dynamo_traceFunction · 0.45
setUpMethod · 0.45
reset_cacheMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected