Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#22 from LiuChiachi/fix-seq2seq-args-bug
Browse files Browse the repository at this point in the history
Fix seq2seq args bug, replace use_gpu with select_device
  • Loading branch information
LiuChiachi authored Feb 20, 2021
2 parents 5b35fb9 + 1fa4663 commit f7bd0ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/machine_translation/seq2seq/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def post_process_seq(seq, bos_idx, eos_idx, output_bos=False, output_eos=False):


def do_predict(args):
device = paddle.set_device("gpu" if args.use_gpu else "cpu")
device = paddle.set_device(args.select_device)

test_loader, src_vocab_size, tgt_vocab_size, bos_id, eos_id = create_infer_loader(
args)
Expand Down
2 changes: 1 addition & 1 deletion examples/machine_translation/seq2seq/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


def do_train(args):
device = paddle.set_device("gpu" if args.use_gpu else "cpu")
device = paddle.set_device(args.select_device)

# Define dataloader
train_loader, eval_loader, src_vocab_size, tgt_vocab_size, eos_id = create_train_loader(
Expand Down

0 comments on commit f7bd0ab

Please sign in to comment.