Skip to content

Commit

Permalink
Training: Add cuda device option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Amos committed Jun 14, 2016
1 parent a1b3251 commit 92684ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion training/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ print(opt)

if opt.cuda then
require 'cutorch'
cutorch.setDevice(1)
cutorch.setDevice(opt.device)
end

torch.save(paths.concat(opt.save, 'opts.t7'), opt, 'ascii')
Expand Down
1 change: 1 addition & 0 deletions training/opts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function M.parse(arg)
'Home of dataset. Split into "train" and "val" directories that separate images by class.')
cmd:option('-manualSeed', 2, 'Manually set RNG seed')
cmd:option('-cuda', true, 'Use cuda.')
cmd:option('-device', 1, 'Cuda device to use.')
cmd:option('-cudnn', true, 'Convert the model to cudnn.')

------------- Data options ------------------------
Expand Down

0 comments on commit 92684ab

Please sign in to comment.