提交 cc49a39e 编写于 作者: S seiriosPlus

add UT

上级 eda4d326
......@@ -40,7 +40,7 @@ class TestCommunicator(unittest.TestCase):
def test_communicator_async(self):
role = role_maker.UserDefinedRoleMaker(
current_id=0,
role=role_maker.Role.WORKER,
role=role_maker.Role.SERVER,
worker_num=2,
server_endpoints=["127.0.0.1:6001", "127.0.0.1:6002"])
......@@ -52,10 +52,6 @@ class TestCommunicator(unittest.TestCase):
optimizer = fleet.distributed_optimizer(optimizer, strategy)
optimizer.minimize(avg_cost)
fleet.init_worker()
time.sleep(10)
fleet.stop_worker()
if __name__ == '__main__':
unittest.main()
......@@ -164,7 +164,7 @@ class TestPSPassWithBow(unittest.TestCase):
fleet.init(role)
loss, acc, _ = self.net()
optimizer = fluid.optimizer.SGD(base_lr)
optimizer = fluid.optimizer.Adam(base_lr)
strategy = StrategyFactory.create_async_strategy()
optimizer = fleet.distributed_optimizer(optimizer, strategy)
optimizer.minimize(loss)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册