第一步!指定gpu import osos.environ["CUDA_VISIBLE_DEVICES"] = '0' 第二步! 对于每一个要踹到gpu去的Tensor或者model x 使用x = x.cuda()就ok了 嘤嘤嘤 相关文章: