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

Method forward

exir/tests/test_memory_planning.py:1353–1360  ·  view source on GitHub ↗
(
                self,
                input_pos: torch.Tensor,
                k_val: torch.Tensor,
                v_val: torch.Tensor,
            )

Source from the content-addressed store, hash-verified

1351 )
1352
1353 def forward(
1354 self,
1355 input_pos: torch.Tensor,
1356 k_val: torch.Tensor,
1357 v_val: torch.Tensor,
1358 ) -> torch.Tensor:
1359 k_out, v_out = self.kv_cache.update(input_pos, k_val, v_val)
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)

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected