src/transformers/models/detr/modeling_detr.py/DetrLoss/_get_src_permutation_idx
class DetrLoss:    def _get_src_permutation_idx(self, indices):
        # permute predictions following indices
        batch_idx = torch.cat([torch.full_like(src, i) for i, (src, _) in enumerate(indices)])
        src_idx = torch.cat([src for (src, _) in indices])
        return batch_idx, src_idx