判断torch.device是gpu还是cpu 这样直接判断是有问题,会有问题,因为torch.device是class类型 device=torch.device('cuda:0') if device!= "cpu": prin...