(self, intensors, N)
| 185 | return outtensors |
| 186 | |
| 187 | def paddingtensor2D(self, intensors, N): |
| 188 | B, n = intensors.shape |
| 189 | padding_tensor = torch.zeros(B, N - n, dtype=intensors.dtype) |
| 190 | outtensors = torch.cat((intensors, padding_tensor), dim=1) |
| 191 | return outtensors |
| 192 | |
| 193 | def __call__(self, features: List[Dict[str, Any]]) -> Dict[str, Any]: |
| 194 | max_length = max(item['hidden_state_big'].shape[1] for item in features) |