def METHOD_NAME(cfg, use_gpu: bool = True):
    """Quantization entry
    Args:
        cfg (dict): quntization configuration.
        use_gpu (bool, optional): whether to use gpu during quantization. Defaults to True.
    """
    logger = get_logger("paddlevideo")
    place = paddle.CUDAPlace(0) if use_gpu else paddle.CPUPlace()
    # get defined params
    batch_nums = cfg.DATASET.pop('batch_nums')
    batch_size = cfg.DATASET.get('batch_size', 1)
    num_workers = cfg.DATASET.get('num_workers', 0)
    inference_file_name = cfg.get('model_name', 'inference')
    inference_model_dir = cfg.get('inference_model_dir',
                                  f'./inference/{inference_file_name}')
    quant_output_dir = cfg.get('quant_output_dir',
                               osp.join(inference_model_dir, 'quant_model'))
    # build dataloader for quantization, lite data is enough
    slim_dataset = build_dataset((cfg.DATASET.quant, cfg.PIPELINE.quant))
    slim_dataloader_setting = dict(batch_size=batch_size,
                                   num_workers=num_workers,
                                   places=place,
                                   drop_last=False,
                                   shuffle=False)
    slim_loader = build_dataloader(slim_dataset, **slim_dataloader_setting)
    logger.info("Build slim_loader finished")
    def sample_generator(loader):
        def __reader__():
            for indx, data in enumerate(loader):
                # must return np.ndarray, not paddle.Tensor
                videos = np.array(data[0])
                yield videos
        return __reader__
    # execute quantization in static graph mode
    paddle.enable_static()
    exe = paddle.static.Executor(place)
    logger.info("Staring Post-Training Quantization...")
    quant_post_static(executor=exe,
                      model_dir=inference_model_dir,
                      quantize_model_path=quant_output_dir,
                      sample_generator=sample_generator(slim_loader),
                      model_filename=f'{inference_file_name}.pdmodel',
                      params_filename=f'{inference_file_name}.pdiparams',
                      batch_size=batch_size,
                      batch_nums=batch_nums,
                      algo='KL')
    logger.info("Post-Training Quantization finished...")