(self, indices)
| 1653 | return losses |
| 1654 | |
| 1655 | def _get_src_permutation_idx(self, indices): |
| 1656 | # permute predictions following indices |
| 1657 | batch_idx = torch.cat( |
| 1658 | [torch.full_like(src, i) for i, (src, _) in enumerate(indices)]) |
| 1659 | src_idx = torch.cat([src for (src, _) in indices]) |
| 1660 | return batch_idx, src_idx |
| 1661 | |
| 1662 | def _get_tgt_permutation_idx(self, indices): |
| 1663 | # permute targets following indices |