(self, indices)
| 798 | return losses |
| 799 | |
| 800 | def _get_src_permutation_idx(self, indices): |
| 801 | # permute predictions following indices |
| 802 | batch_idx = torch.cat( |
| 803 | [torch.full_like(src, i) for i, (src, _) in enumerate(indices)]) |
| 804 | src_idx = torch.cat([src for (src, _) in indices]) |
| 805 | return batch_idx, src_idx |
| 806 | |
| 807 | def _get_tgt_permutation_idx(self, indices): |
| 808 | # permute targets following indices |