utils.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:GAN-Zoo 作者: corenel 项目源码 文件源码
def init_random_seed():
    """Init random seed."""
    seed = None
    if params.manual_seed is None:
        seed = random.randint(1, 10000)
    else:
        seed = params.manual_seed
    print("use random seed: {}".format(seed))
    random.seed(seed)
    torch.manual_seed(seed)
    if torch.cuda.is_available():
        torch.cuda.manual_seed_all(seed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号