将张量从GPU移到CPU上
import torch # 创建一个张量并将其放在GPU上 tensor_gpu = torch.randn((3, 3)).cuda() # 将张量从GPU移动到CPU tensor_cpu = tensor_gpu.cpu()