未验证 提交 0e904d48 编写于 作者: Z zhiboniu 提交者: GitHub

update 2.0 public api in hapi (#32651)

上级 e60c08f7
...@@ -12,17 +12,16 @@ ...@@ -12,17 +12,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from . import logger from . import logger # noqa: F401
from . import callbacks from . import callbacks # noqa: F401
from . import model_summary from . import hub # noqa: F401
from . import hub from . import progressbar # noqa: F401
from . import static_flops # noqa: F401
from . import model from .model import Model # noqa: F401
from .model import * from .model_summary import summary # noqa: F401
from .model_summary import summary from .dynamic_flops import flops # noqa: F401
from .dynamic_flops import flops
logger.setup_logger() logger.setup_logger()
__all__ = ['callbacks'] + model.__all__ + ['summary'] __all__ = []
__all__ = model.__all__ + ['flops']
...@@ -18,7 +18,7 @@ import paddle.nn as nn ...@@ -18,7 +18,7 @@ import paddle.nn as nn
import numpy as np import numpy as np
from .static_flops import static_flops, Table from .static_flops import static_flops, Table
__all__ = ['flops'] __all__ = []
def flops(net, input_size, custom_ops=None, print_detail=False): def flops(net, input_size, custom_ops=None, print_detail=False):
......
...@@ -19,6 +19,8 @@ import shutil ...@@ -19,6 +19,8 @@ import shutil
import zipfile import zipfile
from paddle.utils.download import get_path_from_url from paddle.utils.download import get_path_from_url
__all__ = []
DEFAULT_CACHE_DIR = '~/.cache' DEFAULT_CACHE_DIR = '~/.cache'
VAR_DEPENDENCY = 'dependencies' VAR_DEPENDENCY = 'dependencies'
MODULE_HUBCONF = 'hubconf.py' MODULE_HUBCONF = 'hubconf.py'
......
...@@ -22,6 +22,8 @@ import logging ...@@ -22,6 +22,8 @@ import logging
from paddle.fluid.dygraph.parallel import ParallelEnv from paddle.fluid.dygraph.parallel import ParallelEnv
__all__ = []
def setup_logger(output=None, name="hapi", log_level=logging.INFO): def setup_logger(output=None, name="hapi", log_level=logging.INFO):
""" """
......
...@@ -54,7 +54,7 @@ from paddle.distributed.fleet.base import role_maker ...@@ -54,7 +54,7 @@ from paddle.distributed.fleet.base import role_maker
from .callbacks import config_callbacks, EarlyStopping from .callbacks import config_callbacks, EarlyStopping
from .model_summary import summary from .model_summary import summary
__all__ = ['Model', ] __all__ = []
_parallel_context_initialized = False _parallel_context_initialized = False
......
...@@ -22,7 +22,7 @@ from paddle.static import InputSpec ...@@ -22,7 +22,7 @@ from paddle.static import InputSpec
from collections import OrderedDict from collections import OrderedDict
__all__ = ['summary'] __all__ = []
def summary(net, input_size, dtypes=None): def summary(net, input_size, dtypes=None):
......
...@@ -22,7 +22,7 @@ import time ...@@ -22,7 +22,7 @@ import time
import numpy as np import numpy as np
from collections import namedtuple from collections import namedtuple
__all__ = ['ProgressBar'] __all__ = []
class ProgressBar(object): class ProgressBar(object):
......
...@@ -18,6 +18,8 @@ import paddle ...@@ -18,6 +18,8 @@ import paddle
from collections import OrderedDict from collections import OrderedDict
from paddle.static import Program, program_guard, Variable from paddle.static import Program, program_guard, Variable
__all__ = []
class VarWrapper(object): class VarWrapper(object):
def __init__(self, var, graph): def __init__(self, var, graph):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册