diff --git a/python/paddle/hapi/__init__.py b/python/paddle/hapi/__init__.py index 6b7672828e63dea3af20ff509c68dc9bbba9cf2c..2829bbe94708981f30ffcfdeeff89fd85899e33b 100644 --- a/python/paddle/hapi/__init__.py +++ b/python/paddle/hapi/__init__.py @@ -12,17 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from . import logger -from . import callbacks -from . import model_summary -from . import hub +from . import logger # noqa: F401 +from . import callbacks # noqa: F401 +from . import hub # noqa: F401 +from . import progressbar # noqa: F401 +from . import static_flops # noqa: F401 -from . import model -from .model import * -from .model_summary import summary -from .dynamic_flops import flops +from .model import Model # noqa: F401 +from .model_summary import summary # noqa: F401 +from .dynamic_flops import flops # noqa: F401 logger.setup_logger() -__all__ = ['callbacks'] + model.__all__ + ['summary'] -__all__ = model.__all__ + ['flops'] +__all__ = [] diff --git a/python/paddle/hapi/dynamic_flops.py b/python/paddle/hapi/dynamic_flops.py index 35819d6b7bb555aade60c7114f0ea28c67631ac6..8be6758f1e54b57adadd01025fe9c805556a67d7 100644 --- a/python/paddle/hapi/dynamic_flops.py +++ b/python/paddle/hapi/dynamic_flops.py @@ -18,7 +18,7 @@ import paddle.nn as nn import numpy as np from .static_flops import static_flops, Table -__all__ = ['flops'] +__all__ = [] def flops(net, input_size, custom_ops=None, print_detail=False): diff --git a/python/paddle/hapi/hub.py b/python/paddle/hapi/hub.py index 31a8be0944f3d668d693fd3468bab13738f91a3c..6490c878f9b88152ed8df412172d269c4e9e1721 100644 --- a/python/paddle/hapi/hub.py +++ b/python/paddle/hapi/hub.py @@ -19,6 +19,8 @@ import shutil import zipfile from paddle.utils.download import get_path_from_url +__all__ = [] + DEFAULT_CACHE_DIR = '~/.cache' VAR_DEPENDENCY = 'dependencies' MODULE_HUBCONF = 'hubconf.py' diff --git a/python/paddle/hapi/logger.py b/python/paddle/hapi/logger.py index d4f18ce0ff738c966f1e237beffc9da366e3ae64..ea515d95324675b071f810c813fcf0849490d007 100644 --- a/python/paddle/hapi/logger.py +++ b/python/paddle/hapi/logger.py @@ -22,6 +22,8 @@ import logging from paddle.fluid.dygraph.parallel import ParallelEnv +__all__ = [] + def setup_logger(output=None, name="hapi", log_level=logging.INFO): """ diff --git a/python/paddle/hapi/model.py b/python/paddle/hapi/model.py index 5a33d5b58dc1ae8e2b7a0878973d56ba28e3fa9a..160d6c54759d901e2529221c99dce63b29f06810 100644 --- a/python/paddle/hapi/model.py +++ b/python/paddle/hapi/model.py @@ -54,7 +54,7 @@ from paddle.distributed.fleet.base import role_maker from .callbacks import config_callbacks, EarlyStopping from .model_summary import summary -__all__ = ['Model', ] +__all__ = [] _parallel_context_initialized = False diff --git a/python/paddle/hapi/model_summary.py b/python/paddle/hapi/model_summary.py index 9f2769e1ca285766dcbbd6d852ef5540574eed1c..d78196d94451ed38525c27f729b34e73761e92b3 100644 --- a/python/paddle/hapi/model_summary.py +++ b/python/paddle/hapi/model_summary.py @@ -22,7 +22,7 @@ from paddle.static import InputSpec from collections import OrderedDict -__all__ = ['summary'] +__all__ = [] def summary(net, input_size, dtypes=None): diff --git a/python/paddle/hapi/progressbar.py b/python/paddle/hapi/progressbar.py index cf5a03ed4982b41bf5ea6c8f343e873e0695ea15..5f63a3169f8ac7a09283bed98cc6f96d1193064b 100644 --- a/python/paddle/hapi/progressbar.py +++ b/python/paddle/hapi/progressbar.py @@ -22,7 +22,7 @@ import time import numpy as np from collections import namedtuple -__all__ = ['ProgressBar'] +__all__ = [] class ProgressBar(object): diff --git a/python/paddle/hapi/static_flops.py b/python/paddle/hapi/static_flops.py index 3656e0c18945a6665292ceeb3f167d79505b523e..07fc19b2cb89a588d103140a48f85d3f147d6aa9 100644 --- a/python/paddle/hapi/static_flops.py +++ b/python/paddle/hapi/static_flops.py @@ -18,6 +18,8 @@ import paddle from collections import OrderedDict from paddle.static import Program, program_guard, Variable +__all__ = [] + class VarWrapper(object): def __init__(self, var, graph):