def METHOD_NAME(self, match_scores: Tensor):
    num_prev_bboxes = match_scores.shape[1] - 1
    _, match_ids = match_scores.max(dim=1)
    ids = match_ids.new_zeros(match_ids.shape[0]) - 1
    best_match_scores = match_scores.new_zeros(num_prev_bboxes) - 1e6
    for idx, match_id in enumerate(match_ids):
        if match_id == 0:
            ids[idx] = self.num_tracks
            self.num_tracks += 1
        else:
            match_score = match_scores[idx, match_id]
            # TODO: fix the bug where multiple candidate might match
            # with the same previous object.
            if match_score > best_match_scores[match_id - 1]:
                ids[idx] = self.ids[match_id - 1]
                best_match_scores[match_id - 1] = match_score
    return ids, best_match_scores