diff --git a/python/paddle/__init__.py b/python/paddle/__init__.py index 054fcdfcbe65152111cdf4037161e8cc4aa7e64c..ee4dcaa8979407ee0bcfc4e02af42c08c05efb03 100755 --- a/python/paddle/__init__.py +++ b/python/paddle/__init__.py @@ -269,10 +269,10 @@ from .fluid.layers import crop_tensor as crop # noqa: F401 # high-level api from .hapi import Model # noqa: F401 -from .hapi import callbacks # noqa: F401 +from . import callbacks # noqa: F401 from .hapi import summary # noqa: F401 from .hapi import flops # noqa: F401 -from .hapi import hub # noqa: F401 +from . import hub # noqa: F401 import paddle.text # noqa: F401 import paddle.vision # noqa: F401 @@ -335,10 +335,8 @@ __all__ = [ #noqa 'unsqueeze_', 'argmax', 'Model', - 'callbacks', 'summary', 'flops', - 'hub', 'sort', 'split', 'logical_and', diff --git a/python/paddle/callbacks.py b/python/paddle/callbacks.py new file mode 100644 index 0000000000000000000000000000000000000000..08fab3e0adb5e559bb980500ad5ceebb59198281 --- /dev/null +++ b/python/paddle/callbacks.py @@ -0,0 +1,31 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +from .hapi.callbacks import Callback # noqa: F401 +from .hapi.callbacks import ProgBarLogger # noqa: F401 +from .hapi.callbacks import ModelCheckpoint # noqa: F401 +from .hapi.callbacks import VisualDL # noqa: F401 +from .hapi.callbacks import LRScheduler # noqa: F401 +from .hapi.callbacks import EarlyStopping # noqa: F401 +from .hapi.callbacks import ReduceLROnPlateau # noqa: F401 + +__all__ = [ #noqa + 'Callback', + 'ProgBarLogger', + 'ModelCheckpoint', + 'VisualDL', + 'LRScheduler', + 'EarlyStopping', + 'ReduceLROnPlateau' +] diff --git a/python/paddle/hapi/callbacks.py b/python/paddle/hapi/callbacks.py index cd4b35ea29a83b1962ee93cdad152f82d30b362c..61ae8b42d63a909cc4dc88d4b16f0b0e8ed83c71 100644 --- a/python/paddle/hapi/callbacks.py +++ b/python/paddle/hapi/callbacks.py @@ -25,10 +25,7 @@ from paddle.utils import try_import from .progressbar import ProgressBar -__all__ = [ - 'Callback', 'ProgBarLogger', 'ModelCheckpoint', 'VisualDL', 'LRScheduler', - 'EarlyStopping', 'ReduceLROnPlateau' -] +__all__ = [] def config_callbacks(callbacks=None, diff --git a/python/paddle/hub.py b/python/paddle/hub.py new file mode 100644 index 0000000000000000000000000000000000000000..acdb28cb6f08dfd51e9770c40283eb3f8d98a010 --- /dev/null +++ b/python/paddle/hub.py @@ -0,0 +1,21 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +from .hapi.hub import list # noqa: F401 +from .hapi.hub import help # noqa: F401 +from .hapi.hub import load # noqa: F401 + +__all__ = [ #noqa + 'list', 'help', 'load' +] diff --git a/python/paddle/nn/__init__.py b/python/paddle/nn/__init__.py index 4e4669892b0f0a3333a71836e6fa459390965213..b5a6a5ca07384bdea48a98a95f1a71a8e7f9c071 100644 --- a/python/paddle/nn/__init__.py +++ b/python/paddle/nn/__init__.py @@ -232,10 +232,8 @@ __all__ = [ #noqa 'MaxPool3D', 'AdaptiveMaxPool2D', 'Hardshrink', - 'clip', 'Softplus', 'KLDivLoss', - 'clip_by_norm', 'AvgPool2D', 'L1Loss', 'LeakyReLU', diff --git a/python/paddle/utils/__init__.py b/python/paddle/utils/__init__.py index 40c9d415e11f1b6c8e194235b4ea18abf249b0b8..c23841ea8b802bfec28c2b293d6ac0d57f423d5b 100644 --- a/python/paddle/utils/__init__.py +++ b/python/paddle/utils/__init__.py @@ -19,18 +19,13 @@ from .deprecated import deprecated # noqa: F401 from .lazy_import import try_import # noqa: F401 from .op_version import OpLastCheckpointChecker # noqa: F401 from .install_check import run_check # noqa: F401 -from ..fluid.framework import unique_name # noqa: F401 +from . import unique_name # noqa: F401 from ..fluid.framework import require_version # noqa: F401 from . import download # noqa: F401 from . import image_util # noqa: F401 from . import cpp_extension # noqa: F401 -__all__ = [ #noqa - 'deprecated', - 'download', - 'run_check', - 'unique_name', - 'require_version', - 'try_import' +__all__ = [ #noqa + 'deprecated', 'run_check', 'require_version', 'try_import' ] diff --git a/python/paddle/utils/download.py b/python/paddle/utils/download.py index ddd1dad9dbdf5a08270c9d28a8d4810722003e0e..dda8abeff21c062011ba7e558f330eb92c87836a 100644 --- a/python/paddle/utils/download.py +++ b/python/paddle/utils/download.py @@ -55,7 +55,7 @@ except: import logging logger = logging.getLogger(__name__) -__all__ = [] +__all__ = ['get_weights_path_from_url'] WEIGHTS_HOME = osp.expanduser("~/.cache/paddle/hapi/weights") diff --git a/python/paddle/utils/unique_name.py b/python/paddle/utils/unique_name.py new file mode 100644 index 0000000000000000000000000000000000000000..d0d487c933d767d4f1dca9642d5346bf97b7fe06 --- /dev/null +++ b/python/paddle/utils/unique_name.py @@ -0,0 +1,21 @@ +# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# 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. + +from ..fluid.unique_name import generate # noqa: F401 +from ..fluid.unique_name import switch # noqa: F401 +from ..fluid.unique_name import guard # noqa: F401 + +__all__ = [ #noqa + 'generate', 'switch', 'guard' +]