device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") #或device = torch.device("cuda:0") device1 = torch.device("cuda:1") for batch_idx, (img, label) in enumerate(train_loader): img=img.to(device) label=label.to(device)