(self, input: torch.Tensor, use_cache = True)
| 177 | |
| 178 | |
| 179 | def forward(self, input: torch.Tensor, use_cache = True) -> torch.Tensor: |
| 180 | if use_cache: |
| 181 | if self.cached_tensor is None: |
| 182 | self.cached_tensor = torch.concat([input[:, :, :1]] * 2, dim=2) |
| 183 | input = torch.concat([self.cached_tensor, input], dim=2) |
| 184 | self.cached_tensor = input[:, :, -2:] |
| 185 | return super().forward(input) |
| 186 | |
| 187 | |
| 188 |