from .Initial_Alg_Gen_Tool import get_var_from_file

# 单卡 norm_cfg = dict(type='BN')
# 多卡 norm_cfg = dict(type='SyncBN')
def generate_norm_cfg(GPU_num = 2):
    GPU_num = int(GPU_num)
    if GPU_num == 1:
        return dict(type='BN')
    elif GPU_num > 1:
        return dict(type='SyncBN')
    else:
        raise ValueError("GPU_num需要为大于等于1的整数数值")

if __name__ == '__main__':
    # 示例用法
    GPU_num = 1

    norm_cfg = generate_norm_cfg(GPU_num=GPU_num)
    print(norm_cfg)