diff --git a/python/paddle/distributed/__init__.py b/python/paddle/distributed/__init__.py index 9730e9f95b6f3a2a321db82a0b7d0109099a0524..155037030b5808419a5b17e0d6e5c75c15039a58 100644 --- a/python/paddle/distributed/__init__.py +++ b/python/paddle/distributed/__init__.py @@ -19,7 +19,6 @@ from . import parallel from .parallel import init_parallel_env from .parallel import get_rank from .parallel import get_world_size -from paddle.fluid.dygraph.parallel import prepare_context #DEFINE_ALIAS from paddle.fluid.dygraph.parallel import ParallelEnv #DEFINE_ALIAS from paddle.distributed.fleet.dataset import * @@ -34,7 +33,6 @@ __all__ += [ "init_parallel_env", "get_rank", "get_world_size", - "prepare_context", "ParallelEnv", "InMemoryDataset", "QueueDataset", diff --git a/python/paddle/fluid/tests/unittests/test_directory_migration.py b/python/paddle/fluid/tests/unittests/test_directory_migration.py index 72df01ac1bcad7e6afdf5563db674b8980d5f656..2ec16a9dcab6e62f7ac98b9f111a4ea9e89a4978 100644 --- a/python/paddle/fluid/tests/unittests/test_directory_migration.py +++ b/python/paddle/fluid/tests/unittests/test_directory_migration.py @@ -38,8 +38,7 @@ class TestDirectory(unittest.TestCase): 'paddle.enable_static', 'paddle.disable_static', 'paddle.in_dynamic_mode', 'paddle.to_tensor', 'paddle.grad', 'paddle.no_grad', 'paddle.static.save', 'paddle.static.load', - 'paddle.distributed.ParallelEnv', - 'paddle.distributed.prepare_context', 'paddle.DataParallel', + 'paddle.distributed.ParallelEnv', 'paddle.DataParallel', 'paddle.jit', 'paddle.jit.TracedLayer', 'paddle.jit.to_static', 'paddle.jit.ProgramTranslator', 'paddle.jit.TranslatedLayer', 'paddle.jit.save', 'paddle.jit.load', diff --git a/python/paddle/fluid/tests/unittests/test_imperative_data_parallel.py b/python/paddle/fluid/tests/unittests/test_imperative_data_parallel.py index 428f97c0af8182efdaab31dbd720e523578f2292..d645a0a5ceb60f89e50eac3a83ff00f7b1e3927a 100644 --- a/python/paddle/fluid/tests/unittests/test_imperative_data_parallel.py +++ b/python/paddle/fluid/tests/unittests/test_imperative_data_parallel.py @@ -43,7 +43,7 @@ class MLP(fluid.Layer): class TestDataParallelStateDict(unittest.TestCase): def test_data_parallel_state_dict(self): with fluid.dygraph.guard(): - strategy = paddle.distributed.prepare_context() + strategy = dygraph.parallel.prepare_context() mlp = MLP() parallel_mlp = dygraph.parallel.DataParallel(mlp, strategy)