- 博客(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
2000
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人