src/transformers/models/mask2former/modeling_mask2former.py/Mask2FormerLoss/_max_by_axis
class Mask2FormerLoss:    def _max_by_axis(self, sizes: List[List[int]]) -> List[int]:
        maxes = sizes[0]
        for sublist in sizes[1:]:
            for index, item in enumerate(sublist):
                maxes[index] = max(maxes[index], item)
        return maxes