提交 e6ffdeeb 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5255 Fix no attribute'_graph_data' error in graphdata.py

Merge pull request !5255 from heleiwang/fix_graphdata
...@@ -55,8 +55,8 @@ class GraphData: ...@@ -55,8 +55,8 @@ class GraphData:
set the number of clients expected to connect, and the server will allocate corresponding set the number of clients expected to connect, and the server will allocate corresponding
resources according to this parameter (default=1). resources according to this parameter (default=1).
auto_shutdown (bool, optional): Valid when working_mode is set to 'server', auto_shutdown (bool, optional): Valid when working_mode is set to 'server',
Control when all clients have connected and no client connected to the server, when the number of connected clients reaches num_client and no client is being connected,
automatically exit the server (default=True). the server automatically exits (default=True).
""" """
@check_gnn_graphdata @check_gnn_graphdata
...@@ -69,14 +69,15 @@ class GraphData: ...@@ -69,14 +69,15 @@ class GraphData:
def stop(): def stop():
self._graph_data.stop() self._graph_data.stop()
atexit.register(stop)
if working_mode in ['local', 'client']: if working_mode in ['local', 'client']:
self._graph_data = GraphDataClient(dataset_file, num_parallel_workers, working_mode, hostname, port) self._graph_data = GraphDataClient(dataset_file, num_parallel_workers, working_mode, hostname, port)
atexit.register(stop)
if working_mode == 'server': if working_mode == 'server':
self._graph_data = GraphDataServer( self._graph_data = GraphDataServer(
dataset_file, num_parallel_workers, hostname, port, num_client, auto_shutdown) dataset_file, num_parallel_workers, hostname, port, num_client, auto_shutdown)
atexit.register(stop)
try: try:
while self._graph_data.is_stoped() is not True: while self._graph_data.is_stoped() is not True:
time.sleep(1) time.sleep(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册