(self)
| 227 | # Mimicking LLM with forward taking tokens and input_pos |
| 228 | class ModuleKVCacheInputPos(torch.nn.Module): |
| 229 | def __init__(self): |
| 230 | super().__init__() |
| 231 | self.linear = torch.nn.Linear(3, 3) |
| 232 | |
| 233 | def forward(self, x, input_pos): |
| 234 | return (self.linear(x.to(torch.float)).to(torch.long) + input_pos).to( |