Skip to content

Commit 08a2275

Browse files
authored
fix bug that FLAGS_selected_xpus can't work (#1811)
1 parent 6ff5eab commit 08a2275

File tree

1 file changed

+1
-0
lines changed
  • examples/machine_translation/transformer/static

1 file changed

+1
-0
lines changed

examples/machine_translation/transformer/static/train.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def do_train(args):
9999
places = paddle.static.cuda_places()
100100
elif args.device == "xpu":
101101
places = paddle.static.xpu_places()
102+
paddle.set_device("xpu")
102103
else:
103104
places = paddle.static.cpu_places()
104105
paddle.set_device("cpu")

0 commit comments

Comments
 (0)