Skip to content

Commit 1185baa

Browse files
committed
fix unittest,test=kunlun
1 parent 4b148b8 commit 1185baa

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

python/paddle/fluid/tests/unittests/xpu/test_momentum_op_xpu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ def init_dtype(self):
6060
pass
6161

6262
def test_check_output_with_place(self):
63-
self.check_output_with_place(
64-
paddle.XPUPlace(int(os.getenv("FLAGS_selected_xpus", 0))))
63+
self.check_output_with_place(paddle.XPUPlace(0))
6564

6665

6766
if __name__ == "__main__":

python/paddle/fluid/tests/unittests/xpu/test_sgd_op_xpu.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ def conf(self):
4242
self.w = 105
4343

4444
def test_check_output_with_place(self):
45-
self.check_output_with_place(
46-
paddle.XPUPlace(int(os.getenv("FLAGS_selected_xpus", 0))))
45+
self.check_output_with_place(paddle.XPUPlace(0))
4746

4847

4948
class TestSGDOpCase8X(TestSGDOp):
@@ -65,7 +64,7 @@ def runTest(self):
6564
sgd_optimizer = fluid.optimizer.SGD(learning_rate=0.001)
6665
sgd_optimizer.minimize(avg_cost)
6766

68-
place = paddle.XPUPlace(int(os.getenv("FLAGS_selected_xpus", 0)))
67+
place = paddle.XPUPlace(0)
6968
exe = fluid.Executor(place)
7069
exe.run(fluid.default_startup_program())
7170
result = exe.run(fluid.default_main_program(), fetch_list=[avg_cost])

0 commit comments

Comments
 (0)