(offset)
| 90 | |
| 91 | |
| 92 | def offset2batch(offset): |
| 93 | return torch.cat([ |
| 94 | torch.tensor([i] * (o - offset[i - 1])) if i > 0 else torch.tensor([i] * o) |
| 95 | for i, o in enumerate(offset) |
| 96 | ], dim=0).long().to(offset.device) |
| 97 | |
| 98 | |
| 99 | def batch2offset(batch): |
nothing calls this directly
no outgoing calls
no test coverage detected