def __init__(self, cfg, model, tta_mapper=None, batch_size=3):
        """
        Args:
            cfg (CfgNode):
            model (GeneralizedRCNN): a GeneralizedRCNN to apply TTA on.
            tta_mapper (callable): takes a dataset dict and returns a list of
                augmented versions of the dataset dict. Defaults to
                `DatasetMapperTTA(cfg)`.
            batch_size (int): batch the augmented images into this batch size for inference.
        """
        super().__init__()
        if isinstance(model, DistributedDataParallel):
            model = model.module
        assert isinstance(
            model, GeneralizedRCNN
        ), "TTA is only supported on GeneralizedRCNN. Got a model of type {}".format(type(model))
        self.cfg = copy.deepcopy(cfg)
        if isinstance(cfg, CfgNode):
            assert not self.cfg.MODEL.KEYPOINT_ON, "TTA for keypoint is not supported yet"
            assert (
                not self.cfg.MODEL.LOAD_PROPOSALS
            ), "TTA for pre-computed proposals is not supported yet"

        self.model = model

        if tta_mapper is None:
            tta_mapper = DatasetMapperTTA(cfg)
        self.tta_mapper = tta_mapper
        self.batch_size = batch_size
        # self.size2scale = {
        #     416: [256 ** 2, 1e5 ** 2],
        #     512: [160 ** 2, 1e5 ** 2],
        #     608: [128 ** 2, 1e5 ** 2],
        #     704: [96 ** 2, 256 ** 2],
        #     800: [64 ** 2, 128 ** 2],
        #     1280: [48 ** 2, 128 ** 2],
        #     1408: [32 ** 2, 64 ** 2],
        #     1536: [16 ** 2, 64 ** 2],
        #     1664: [24 ** 2, 48 ** 2],
        #     1792: [8 ** 2, 32 ** 2],
        #     1920: [16 ** 2, 32 ** 2],
        #     2048: [8 ** 2, 16 ** 2],
        #     2176: [0 ** 2, 24 ** 2],
        #     2304: [0 ** 2, 24 ** 2],
        #     2432: [0 ** 2, 16 ** 2],
        #     2560: [0 ** 2, 16 ** 2],
        # }
        # self.size2scale = {
        #     416: [256 ** 2, 1e5 ** 2],
        #     512: [160 ** 2, 1e5 ** 2],
        #     608: [128 ** 2, 1e5 ** 2],
        #     704: [96 ** 2, 256 ** 2],
        #     800: [64 ** 2, 128 ** 2],
        #     1280: [32 ** 2, 1e5 ** 2],
        #     # 1408: [32 ** 2, 64 ** 2],
        #     1536: [16 ** 2, 1e5 ** 2],
        #     1664: [0 ** 2, 1e5 ** 2],
        #     1792: [0 ** 2, 16 ** 2],
        #     1920: [0 ** 2, 24 ** 2],
        #     2048: [0 ** 2, 16 ** 2],
        #     2176: [0 ** 2, 24 ** 2],
        #     2304: [0 ** 2, 24 ** 2],
        #     2432: [0 ** 2, 16 ** 2],
        #     2560: [0 ** 2, 16 ** 2],
        # }
        self.size2scale = {
            1280: [32 ** 2, 1e5 ** 2],
            1536: [16 ** 2, 1e5 ** 2],
            1664: [0 ** 2, 1e5 ** 2],
            1792: [0 ** 2, 16 ** 2],
            1920: [0 ** 2, 24 ** 2],
            2048: [0 ** 2, 16 ** 2],
        }

        Args:
            cfg (CfgNode):
            model (GeneralizedRCNN): a GeneralizedRCNN to apply TTA on.
            tta_mapper (callable): takes a dataset dict and returns a list of
                augmented versions of the dataset dict. Defaults to
                `DatasetMapperTTA(cfg)`.
            batch_size (int): batch the augmented images into this batch size for inference.
        
EVA-02/det/detectron2/modeling/test_time_augmentation.py