seed = 2023
torch.manual_seed(seed)            # torch的CPU随机性,为CPU设置随机种子
torch.cuda.manual_seed(seed)       # torch的GPU随机性,为当前GPU设置随机种子
torch.cuda.manual_seed_all(seed)   # torch的GPU随机性,为所有GPU设置随机种子
posted on 2023-10-22 11:17  孜孜不倦fly  阅读(147)  评论(0)    收藏  举报