- 博客(1)
- 收藏
- 关注
原创 CPU&GPU
常用函数 #设置设备device=torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')#判断是否有cuda可用if_cuda=torch.cuda.is_available()#统计gpu个数gpu_count=torch.cuda.device_count()#将模型设置为多个gpu并行模式model=torch.nn.DataParallel(net)optim=optim.SGD(model.mod..
2022-01-30 16:48:34
1950
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人