(self, intensors, N)
| 176 | return outtensors |
| 177 | |
| 178 | def paddingtensor2D(self, intensors, N): |
| 179 | B, n = intensors.shape |
| 180 | padding_tensor = torch.zeros(B, N - n, dtype=intensors.dtype) |
| 181 | outtensors = torch.cat((intensors, padding_tensor), dim=1) |
| 182 | return outtensors |
| 183 | |
| 184 | def __call__(self, features: List[Dict[str, Any]]) -> Dict[str, Any]: |
| 185 | max_length = max(item['hidden_state_big'].shape[1] for item in features) |