(self, xy, batch)
| 308 | return offsets |
| 309 | |
| 310 | def interleave(self, xy, batch): |
| 311 | nu = len(xy) - 1 |
| 312 | offsets = self.interleave_offsets(batch, nu) |
| 313 | xy = [[v[offsets[p]:offsets[p + 1]] for p in range(nu + 1)] for v in xy] |
| 314 | for i in range(1, nu + 1): |
| 315 | xy[0][i], xy[i][i] = xy[i][i], xy[0][i] |
| 316 | return [torch.cat(v, dim=0) for v in xy] |
| 317 | |
| 318 | |
| 319 | if __name__ == "__main__": |
no test coverage detected