未验证 提交 72302033 编写于 作者: S ShenLiang 提交者: GitHub

fix bug (#32135)

上级 f74f9762
...@@ -18,7 +18,7 @@ import unittest ...@@ -18,7 +18,7 @@ import unittest
import time import time
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.distributed.utils import find_free_ports, watch_local_trainers, get_cluster, get_gpus, start_local_trainers from paddle.distributed.utils import find_free_ports, watch_local_trainers, get_cluster, start_local_trainers
def get_cluster_from_args(selected_gpus): def get_cluster_from_args(selected_gpus):
...@@ -41,6 +41,11 @@ def get_cluster_from_args(selected_gpus): ...@@ -41,6 +41,11 @@ def get_cluster_from_args(selected_gpus):
return get_cluster(node_ips, node_ip, trainer_endpoints, selected_gpus) return get_cluster(node_ips, node_ip, trainer_endpoints, selected_gpus)
def get_gpus(selected_gpus):
selected_gpus = [x.strip() for x in selected_gpus.split(',')]
return selected_gpus
class TestMultipleGpus(unittest.TestCase): class TestMultipleGpus(unittest.TestCase):
def run_mnist_2gpu(self, target_file_name): def run_mnist_2gpu(self, target_file_name):
if not fluid.core.is_compiled_with_cuda( if not fluid.core.is_compiled_with_cuda(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册