Skip to content

Commit

Permalink
make model cuda if available
Browse files Browse the repository at this point in the history
  • Loading branch information
timbmg authored Apr 6, 2018
1 parent 4342595 commit e1df0eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def main(args):
model.load_state_dict(torch.load(args.load_checkpoint))
print("Model loaded from %s"%(args.load_checkpoint))

if torch.cuda.is_available():
model = model.cuda()

model.eval()

samples, z = model.inference(n=args.num_samples)
Expand Down

0 comments on commit e1df0eb

Please sign in to comment.