使用方法:model为自己的模型 device_ids = [0, 1] model = torch.nn.DataParallel(model, device_ids=device_ids) 这样就可以在0号和1号GPU上跑了