pytorch设置gpu

# 获取当前设备
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
posted @ 2020-12-16 11:29  致林  阅读(505)  评论(0编辑  收藏  举报