提交 41ad3a60 编写于 作者: T TomorrowIsAnOtherDay

update paddle_gpu_test.py

上级 2e24f418
...@@ -28,8 +28,8 @@ import os ...@@ -28,8 +28,8 @@ import os
@parl.remote_class @parl.remote_class
class Actor(object): class Actor(object):
def __init__(self): def __init__(self, cuda=False):
if parl.utils.is_gpu_available(): if cuda:
place = fluid.CUDAPlace(0) place = fluid.CUDAPlace(0)
else: else:
place = fluid.CPUPlace() place = fluid.CPUPlace()
...@@ -51,7 +51,10 @@ class TestCluster(unittest.TestCase): ...@@ -51,7 +51,10 @@ class TestCluster(unittest.TestCase):
parl.connect('localhost:8241') parl.connect('localhost:8241')
actor = Actor() if parl.utils.is_gpu_available():
actor = Actor(cuda=True)
else:
actor = Actor(cuda=False)
del actor del actor
master.exit() master.exit()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册