From 698128dd4ca5e5eda717eb304d8837b3b9b1ca4c Mon Sep 17 00:00:00 2001 From: JYChen Date: Wed, 2 Nov 2022 22:23:25 +0800 Subject: [PATCH] remove functions not belong to public-api from __all__ (#47502) --- python/paddle/audio/datasets/esc50.py | 2 +- python/paddle/audio/datasets/tess.py | 2 +- python/paddle/distributed/communication/__init__.py | 2 -- python/paddle/geometric/message_passing/__init__.py | 6 +----- python/paddle/geometric/sampling/__init__.py | 4 +--- python/paddle/incubate/multiprocessing/__init__.py | 2 -- python/paddle/tensor/ops.py | 9 --------- 7 files changed, 4 insertions(+), 23 deletions(-) diff --git a/python/paddle/audio/datasets/esc50.py b/python/paddle/audio/datasets/esc50.py index 1d3e0e07ba..b50845eda2 100644 --- a/python/paddle/audio/datasets/esc50.py +++ b/python/paddle/audio/datasets/esc50.py @@ -20,7 +20,7 @@ from paddle.utils import download from paddle.dataset.common import DATA_HOME from .dataset import AudioClassificationDataset -__all__ = ['ESC50'] +__all__ = [] class ESC50(AudioClassificationDataset): diff --git a/python/paddle/audio/datasets/tess.py b/python/paddle/audio/datasets/tess.py index b180d704e6..a379aedc60 100644 --- a/python/paddle/audio/datasets/tess.py +++ b/python/paddle/audio/datasets/tess.py @@ -20,7 +20,7 @@ from paddle.utils import download from paddle.dataset.common import DATA_HOME from .dataset import AudioClassificationDataset -__all__ = ['TESS'] +__all__ = [] class TESS(AudioClassificationDataset): diff --git a/python/paddle/distributed/communication/__init__.py b/python/paddle/distributed/communication/__init__.py index 95d6c31580..97043fd7ba 100644 --- a/python/paddle/distributed/communication/__init__.py +++ b/python/paddle/distributed/communication/__init__.py @@ -11,5 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -__all__ = ["stream"] diff --git a/python/paddle/geometric/message_passing/__init__.py b/python/paddle/geometric/message_passing/__init__.py index f215e5be74..c07f9bc40c 100644 --- a/python/paddle/geometric/message_passing/__init__.py +++ b/python/paddle/geometric/message_passing/__init__.py @@ -16,8 +16,4 @@ from .send_recv import send_u_recv # noqa: F401 from .send_recv import send_ue_recv # noqa: F401 from .send_recv import send_uv # noqa: F401 -__all__ = [ - 'send_u_recv', - 'send_ue_recv', - 'send_uv', -] +__all__ = [] diff --git a/python/paddle/geometric/sampling/__init__.py b/python/paddle/geometric/sampling/__init__.py index 282fb8fd56..2e5b24fdd6 100644 --- a/python/paddle/geometric/sampling/__init__.py +++ b/python/paddle/geometric/sampling/__init__.py @@ -14,6 +14,4 @@ from .neighbors import sample_neighbors # noqa: F401 -__all__ = [ - 'sample_neighbors', -] +__all__ = [] diff --git a/python/paddle/incubate/multiprocessing/__init__.py b/python/paddle/incubate/multiprocessing/__init__.py index 27c23be3a8..df0f98f74d 100644 --- a/python/paddle/incubate/multiprocessing/__init__.py +++ b/python/paddle/incubate/multiprocessing/__init__.py @@ -19,8 +19,6 @@ __all__ = [] from multiprocessing import * # noqa: F403 -__all__ += multiprocessing.__all__ # type: ignore[attr-defined] - # Only support linux for now # Only support file_system sharing strategy. diff --git a/python/paddle/tensor/ops.py b/python/paddle/tensor/ops.py index 4a5994076c..0f5bac3c6e 100644 --- a/python/paddle/tensor/ops.py +++ b/python/paddle/tensor/ops.py @@ -57,9 +57,6 @@ __inplace_unary_func__ = [ __all__ = [] -for _OP in set(__all__): - globals()[_OP] = generate_layer_fn(_OP) - # It is a hot fix in some unittest using: # fluid.layers.scale(x=x, scale=10.0, out=out_var) # e.g.: test_program_code.py, test_dist_train.py @@ -67,10 +64,6 @@ globals()['_scale'] = generate_layer_fn('scale') globals()['_elementwise_div'] = generate_layer_fn('elementwise_div') -__all__ += __activations_noattr__ -__all__ += __unary_func__ -__all__ += __inplace_unary_func__ - for _OP in set(__activations_noattr__): _new_OP = _OP if _OP in __deprecated_func_name__: @@ -932,8 +925,6 @@ def tan(x, name=None): return out -__all__ += ['erf'] - _erf_ = generate_layer_fn('erf') -- GitLab