def METHOD_NAME(cfg: TorchBenchModelConfig) -> bool:
    if cfg.device in allowed_devices and cfg.test in allowed_tests:
        if not allowed_models:
            return True
        else:
            return cfg.name in allowed_models
    return False