From ed2309719c626610a2668422c5b3f01e89e8f35d Mon Sep 17 00:00:00 2001 From: yh_cc Date: Sun, 5 Jul 2020 23:24:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=AAdata=5Fpara?= =?UTF-8?q?llel=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84gpu=E4=B8=8D=E4=BB=8E0?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E5=AF=BC=E8=87=B4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastNLP/core/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastNLP/core/utils.py b/fastNLP/core/utils.py index 74c812a2..d324af72 100644 --- a/fastNLP/core/utils.py +++ b/fastNLP/core/utils.py @@ -409,7 +409,7 @@ def _move_model_to_device(model, device): if device is None: if isinstance(model, torch.nn.DataParallel): - model.cuda() + model.cuda(model.device_ids[0]) return model else: if not torch.cuda.is_available() and ((isinstance(device, str) and device!='cpu') or