python常用代码总结-python常用代码
常用代码片段及技巧自动选择GPU和CPUdevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')# model and tensor to devicevgg = models.vgg16().to(device)切换当前目录import ostry:os.chdir(os.path.join(os.getcwd()...