Skip to content

Commit 51248f8

Browse files
authored
[Cherry-pick] remove functions not belong to public-api from __all__ (#47577)
* remove functions not belong to public-api from __all__ * fix code style * fix error in distributed
1 parent ea5f44b commit 51248f8

File tree

8 files changed

+167
-92
lines changed

8 files changed

+167
-92
lines changed

python/paddle/audio/datasets/esc50.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from paddle.dataset.common import DATA_HOME
2121
from .dataset import AudioClassificationDataset
2222

23-
__all__ = ['ESC50']
23+
__all__ = []
2424

2525

2626
class ESC50(AudioClassificationDataset):

python/paddle/audio/datasets/tess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from paddle.dataset.common import DATA_HOME
2121
from .dataset import AudioClassificationDataset
2222

23-
__all__ = ['TESS']
23+
__all__ = []
2424

2525

2626
class TESS(AudioClassificationDataset):

python/paddle/distributed/__init__.py

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
from .collective import P2POp # noqa: F401
5252
from .collective import reduce_scatter # noqa: F401
5353

54-
from .communication import * # noqa: F401
54+
from .communication import stream
5555

5656
from .auto_parallel import shard_op # noqa: F401
5757
from .auto_parallel import shard_tensor # noqa: F401
@@ -66,15 +66,43 @@
6666

6767
from . import cloud_utils # noqa: F401
6868

69-
from .sharding import * # noqa: F401
69+
from .sharding import group_sharded_parallel, save_group_sharded_model
7070

7171
__all__ = [ # noqa
72-
"spawn", "launch", "scatter", "broadcast", "ParallelEnv", "new_group",
73-
"init_parallel_env", "gloo_init_parallel_env", "gloo_barrier",
74-
"gloo_release", "QueueDataset", "split", "CountFilterEntry",
75-
"ShowClickEntry", "get_world_size", "get_group", "all_gather",
76-
"all_gather_object", "InMemoryDataset", "barrier", "all_reduce", "alltoall",
77-
"alltoall_single", "send", "reduce", "recv", "ReduceOp", "wait", "get_rank",
78-
"ProbabilityEntry", "ParallelMode", "is_initialized",
79-
"destroy_process_group", "isend", "irecv", "reduce_scatter", "stream"
72+
"spawn",
73+
"launch",
74+
"scatter",
75+
"broadcast",
76+
"ParallelEnv",
77+
"new_group",
78+
"init_parallel_env",
79+
"gloo_init_parallel_env",
80+
"gloo_barrier",
81+
"gloo_release",
82+
"QueueDataset",
83+
"split",
84+
"CountFilterEntry",
85+
"ShowClickEntry",
86+
"get_world_size",
87+
"get_group",
88+
"all_gather",
89+
"all_gather_object",
90+
"InMemoryDataset",
91+
"barrier",
92+
"all_reduce",
93+
"alltoall",
94+
"alltoall_single",
95+
"send",
96+
"reduce",
97+
"recv",
98+
"ReduceOp",
99+
"wait",
100+
"get_rank",
101+
"ProbabilityEntry",
102+
"ParallelMode",
103+
"is_initialized",
104+
"destroy_process_group",
105+
"isend",
106+
"irecv",
107+
"reduce_scatter",
80108
]

python/paddle/distributed/communication/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
15-
__all__ = ["stream"]

python/paddle/geometric/message_passing/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,4 @@
1616
from .send_recv import send_ue_recv # noqa: F401
1717
from .send_recv import send_uv # noqa: F401
1818

19-
__all__ = [
20-
'send_u_recv',
21-
'send_ue_recv',
22-
'send_uv',
23-
]
19+
__all__ = []

python/paddle/geometric/sampling/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@
1414

1515
from .neighbors import sample_neighbors # noqa: F401
1616

17-
__all__ = [
18-
'sample_neighbors',
19-
]
17+
__all__ = []

python/paddle/incubate/multiprocessing/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
from multiprocessing import * # noqa: F403
2121

22-
__all__ += multiprocessing.__all__ # type: ignore[attr-defined]
23-
2422
# Only support linux for now
2523
# Only support file_system sharing strategy.
2624

0 commit comments

Comments
 (0)