title: pytorch 随机数设置初始值
date: 2018-07-30 13:00:27

tags:

1
2
3
4
5
use_cuda = torch.cuda.is_available() and not args.no_cuda
device = torch.device('cuda' if use_cuda else 'cpu')
torch.manual_seed(args.seed)
if use_cuda:
torch.cuda.manual_seed(args.seed)
请作者喝一杯咖啡☕️