Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vince62s committed Sep 17, 2018
1 parent 48a760d commit 14f8202
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion onmt/inputters/inputter.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def batch_size_fn(new, count, sofar):
batch_size_fn = None
# device = opt.device_id if opt.gpuid else -1
# breaking change torchtext 0.3
if opt.gpuid:
if opt.gpu_ranks:
device = "cuda"
else:
device = "cpu"
Expand Down
2 changes: 1 addition & 1 deletion onmt/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def use_gpu(opt):
"""
Creates a boolean if gpu used
"""
return (hasattr(opt, 'gpuid') and len(opt.gpuid) > 0) or \
return (hasattr(opt, 'gpu_ranks') and len(opt.gpu_ranks) > 0) or \
(hasattr(opt, 'gpu') and opt.gpu > -1)

0 comments on commit 14f8202

Please sign in to comment.