class_docstr: This class computes the loss for DETR.
  The process happens in two steps:
      1) we compute hungarian assignment between ground truth boxes and the outputs of the model
      2) we supervise each pair of matched ground-truth / prediction (supervise class and box)
class_docstr_tok: ["This","class","computes","the","loss","for","DETR",".","The","process","happens","in","two","steps",":","1",")","we","compute","hungarian","assignment","between","ground","truth","boxes","and","the","outputs","of","the","model","2",")","we","supervise","each","pair","of","matched","ground-truth","\/","prediction","(","supervise","class","and","box",")"]
code: def _get_tgt_permutation_idx(self, indices):
      # permute targets following indices
      batch_idx = torch.cat(
          [
              torch.full_like(tgt, i)
              for i, (_, tgt) in enumerate(indices)
          ]
      )
      tgt_idx = torch.cat([tgt for (_, tgt) in indices])
      return batch_idx, tgt_idx
  
imports: import torch
  import torch.nn.functional
  from torch import nn
  from util import box_ops
  from util.misc import NestedTensor, nested_tensor_from_tensor_list, accuracy, get_world_size, interpolate, is_dist_avail_and_initialized
  from .backbone import build_backbone
  from .matcher import build_matcher
  from .segmentation import DETRsegm, PostProcessPanoptic, PostProcessSegm, dice_loss, sigmoid_focal_loss
  from .transformer import build_transformer
label_desc: Use image node_id 7 for calling the SetCriterion obj's underlying member method code with example usage: obj._get_tgt_permutation_idx(indices) and returns: batch_idx,  tgt_idx