Skip to content

Commit 1a4bac9

Browse files
author
kuangliu
authored
Merge pull request pytorch#3 from fducau/master
Solve not working with 1 GPU
2 parents 6b8115a + 64686f1 commit 1a4bac9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
if use_cuda:
6565
net.cuda()
66-
net = torch.nn.DataParallel(net, device_ids=[0,1,2,3])
66+
net = torch.nn.DataParallel(net, device_ids=range(torch.cuda.device_count()))
6767
cudnn.benchmark = True
6868

6969
criterion = nn.CrossEntropyLoss()

0 commit comments

Comments
 (0)