def METHOD_NAME(config, cuda=False):
    weights = config.get("weights")
    model = load_model(
        config.get("model"),
        pretrained=config.get("pretrained", True) if weights is None else False,
        num_classes=config.get("num_classes", 1000),
        model_params=config.get("model_params", {}),
    )
    compression_ctrl, model = create_compressed_model(model, config)
    if weights:
        sd = torch.load(weights, map_location="cpu")
        load_state(model, sd)
    if cuda:
        model = model.cuda()
        model = torch.nn.DataParallel(model)
    print(compression_ctrl.statistics().to_str())
    return model