cuda ()) # 在GPU 1上分配张量 with torch.cuda.device(1): # GPU 1 a = torch.tensor([1., 2.], device=cuda) # 从CPU传递到GPU 1 # a、b所在的设备都 ...
確定! 回上一頁