Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 93b3441

Browse filesBrowse files
committed
fix test_models.py
1 parent 357c863 commit 93b3441
Copy full SHA for 93b3441

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Collapse file

‎test_models.py‎

Copy file name to clipboardExpand all lines: test_models.py
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@
8383
batch_size=1, shuffle=False,
8484
num_workers=args.workers * 2, pin_memory=True)
8585

86-
net = torch.nn.DataParallel(net, device_ids=list(range(args.workers)))
86+
if args.gpus is not None:
87+
devices = [args.gpus[i] for i in range(args.workers)]
88+
else:
89+
devices = list(range(args.workers))
90+
91+
92+
net = torch.nn.DataParallel(net, device_ids=devices)
8793
net.cuda()
8894
net.eval()
8995

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.