(self, xy, batch)
| 355 | return offsets |
| 356 | |
| 357 | def interleave(self, xy, batch): |
| 358 | nu = len(xy) - 1 |
| 359 | offsets = self.interleave_offsets(batch, nu) |
| 360 | xy = [[v[offsets[p]:offsets[p + 1]] for p in range(nu + 1)] for v in xy] |
| 361 | for i in range(1, nu + 1): |
| 362 | xy[0][i], xy[i][i] = xy[i][i], xy[0][i] |
| 363 | return [torch.cat(v, dim=0) for v in xy] |
| 364 | |
| 365 | |
| 366 | if __name__ == "__main__": |
no test coverage detected