| 115 | ) -> torch.export.ExportedProgram: |
| 116 | # Wrapper since torch.export only exports forward(). |
| 117 | class EtCacheWrapper(torch.nn.Module): |
| 118 | def __init__(self, kv_cache: torch.nn.Module): |
| 119 | super().__init__() |
| 120 | self.kv_cache = kv_cache |
| 121 | |
| 122 | def forward(self, k_val: torch.Tensor, v_val: torch.Tensor): |
| 123 | return self.kv_cache.update(k_val, v_val) |
| 124 | |
| 125 | dim = torch.export.Dim("seq_len_dim", min=1, max=self.max_seq_len) |
| 126 | exported_kv_cache = torch.export.export( |
no outgoing calls