Posted on 2018-07-Mon Views: Views: title: pytorch 随机数设置初始值date: 2018-07-30 13:00:27tags:12345use_cuda = torch.cuda.is_available() and not args.no_cudadevice = torch.device('cuda' if use_cuda else 'cpu')torch.manual_seed(args.seed)if use_cuda: torch.cuda.manual_seed(args.seed)