docstr: 计算anchors与每个gtboxes匹配的iou最大值，并记录索引，
  iou<low_threshold索引值为-1， low_threshold<=iou<high_threshold索引值为-2
  Args:
      match_quality_matrix (Tensor[float]): an MxN tensor, containing the
      pairwise quality between M ground-truth elements and N predicted elements.
  
  Returns:
      matches (Tensor[int64]): an N tensor where N[i] is a matched gt in
      [0, M - 1] or a negative value indicating that prediction i could not
      be matched.
docstr_tok: ["\u8ba1\u7b97anchors\u4e0e\u6bcf\u4e2agtboxes\u5339\u914d\u7684iou\u6700\u5927\u503c\uff0c\u5e76\u8bb0\u5f55\u7d22\u5f15\uff0c","iou","<","low_threshold\u7d22\u5f15\u503c\u4e3a-1\uff0c","low_threshold","<","=iou","<","high_threshold\u7d22\u5f15\u503c\u4e3a-2","Args",":","match_quality_matrix","(","Tensor","[","float","]",")",":","an","MxN","tensor",",","containing","the","pairwise","quality","between","M","ground-truth","elements","and","N","predicted","elements",".","Returns",":","matches","(","Tensor","[","int64","]",")",":","an","N","tensor","where","N","[","i","]","is","a","matched","gt","in","[","0",",","M","-","1","]","or","a","negative","value","indicating","that","prediction","i","could","not","be","matched","."]
code: def __call__(self, match_quality_matrix):
      """
      计算anchors与每个gtboxes匹配的iou最大值，并记录索引，
      iou<low_threshold索引值为-1， low_threshold<=iou<high_threshold索引值为-2
      Args:
          match_quality_matrix (Tensor[float]): an MxN tensor, containing the
          pairwise quality between M ground-truth elements and N predicted elements.
  
      Returns:
          matches (Tensor[int64]): an N tensor where N[i] is a matched gt in
          [0, M - 1] or a negative value indicating that prediction i could not
          be matched.
      """
      if match_quality_matrix.numel() == 0:
          # empty targets or proposals not supported during training
          if match_quality_matrix.shape[0] == 0:
              raise ValueError(
                  "No ground-truth boxes available for one of the images "
                  "during training"
              )
          else:
              raise ValueError(
                  "No proposal boxes available for one of the images "
                  "during training"
              )
  
      # match_quality_matrix is M (gt) x N (predicted)
      # Max over gt elements (dim 0) to find best gt candidate for each prediction
      # M x N 的每一列代表一个anchors与所有gt的匹配iou值
      # matched_vals代表每列的最大值，即每个anchors与所有gt匹配的最大iou值
      # matches对应最大值所在的索引
      matched_vals, matches = match_quality_matrix.max(
          dim=0
      )  # the dimension to reduce.
      if self.allow_low_quality_matches:
          all_matches = matches.clone()
      else:
          all_matches = None
  
      # Assign candidate matches with low quality to negative (unassigned) values
      # 计算iou小于low_threshold的索引
      below_low_threshold = matched_vals < self.low_threshold
      # 计算iou在low_threshold与high_threshold之间的索引值
      between_thresholds = (matched_vals >= self.low_threshold) & (
          matched_vals < self.high_threshold
      )
      # iou小于low_threshold的matches索引置为-1
      matches[below_low_threshold] = self.BELOW_LOW_THRESHOLD  # -1
  
      # iou在[low_threshold, high_threshold]之间的matches索引置为-2
      matches[between_thresholds] = self.BETWEEN_THRESHOLDS  # -2
  
      if self.allow_low_quality_matches:
          assert all_matches is not None
          self.set_low_quality_matches_(
              matches, all_matches, match_quality_matrix
          )
  
      return matches
  
imports: import torch
  import math
  from typing import List, Tuple
  from torch import Tensor
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