class_docstr: This class assigns to each predicted "element" (e.g., a box) a ground-truth
  element. Each predicted element will have exactly zero or one matches; each
  ground-truth element may be matched to zero or more predicted elements.
  
  The matching is determined by the MxN match_quality_matrix, that characterizes
  how well each (ground-truth, prediction)-pair match each other. For example,
  if the elements are boxes, this matrix may contain box intersection-over-union
  overlap values.
  
  The matcher returns (a) a vector of length N containing the index of the
  ground-truth element m in [0, M) that matches to prediction n in [0, N).
  (b) a vector of length N containing the labels for each prediction.
docstr: Args:
      match_quality_matrix (Tensor[float]): an MxN tensor, containing the
          pairwise quality between M ground-truth elements and N predicted
          elements. All elements must be >= 0 (due to the us of `torch.nonzero`
          for selecting indices in :meth:`set_low_quality_matches_`).
  
  Returns:
      matches (Tensor[int64]): a vector of length N, where matches[i] is a matched
          ground-truth index in [0, M)
      match_labels (Tensor[int8]): a vector of length N, where pred_labels[i] indicates
          whether a prediction is a true or false positive or ignored
docstr_tok: ["Args",":","match_quality_matrix","(","Tensor","[","float","]",")",":","an","MxN","tensor",",","containing","the","pairwise","quality","between","M","ground-truth","elements","and","N","predicted","elements",".","All","elements","must","be",">","=","0","(","due","to","the","us","of","`","torch.nonzero","`","for","selecting","indices","in",":","meth",":","`","set_low_quality_matches_","`",")",".","Returns",":","matches","(","Tensor","[","int64","]",")",":","a","vector","of","length","N",",","where","matches","[","i","]","is","a","matched","ground-truth","index","in","[","0",",","M",")","match_labels","(","Tensor","[","int8","]",")",":","a","vector","of","length","N",",","where","pred_labels","[","i","]","indicates","whether","a","prediction","is","a","true","or","false","positive","or","ignored"]
code: def __call__(self, match_quality_matrix):
      """
      Args:
          match_quality_matrix (Tensor[float]): an MxN tensor, containing the
              pairwise quality between M ground-truth elements and N predicted
              elements. All elements must be >= 0 (due to the us of `torch.nonzero`
              for selecting indices in :meth:`set_low_quality_matches_`).
  
      Returns:
          matches (Tensor[int64]): a vector of length N, where matches[i] is a matched
              ground-truth index in [0, M)
          match_labels (Tensor[int8]): a vector of length N, where pred_labels[i] indicates
              whether a prediction is a true or false positive or ignored
      """
      assert match_quality_matrix.dim() == 2
      if match_quality_matrix.numel() == 0:
          default_matches = match_quality_matrix.new_full(
              (match_quality_matrix.size(1),), 0, dtype=torch.int64
          )
          # When no gt boxes exist, we define IOU = 0 and therefore set labels
          # to `self.labels[0]`, which usually defaults to background class 0
          # To choose to ignore instead, can make labels=[-1,0,-1,1] + set appropriate thresholds
          default_match_labels = match_quality_matrix.new_full(
              (match_quality_matrix.size(1),),
              self.labels[0],
              dtype=torch.int8,
          )
          return default_matches, default_match_labels
  
      assert torch.all(match_quality_matrix >= 0)
  
      # match_quality_matrix is M (gt) x N (predicted)
      # Max over gt elements (dim 0) to find best gt candidate for each prediction
      matched_vals, matches = match_quality_matrix.max(dim=0)
  
      match_labels = matches.new_full(
          matches.size(), 1, dtype=torch.int8
      )
  
      for l, low, high in zip(
          self.labels, self.thresholds[:-1], self.thresholds[1:]
      ):
          low_high = (matched_vals >= low) & (matched_vals < high)
          match_labels[low_high] = l
  
      if self.allow_low_quality_matches:
          self.set_low_quality_matches_(
              match_labels, match_quality_matrix
          )
  
      return matches, match_labels
  
imports: from typing import List
  import torch
  from detectron2.layers import nonzero_tuple
label_desc: Use image node_id 2 for calling the Matcher obj's underlying member method code with example usage: obj.__call__(match_quality_matrix) and returns: matches,  match_labels, default_matches,  default_match_labels