Skip to content

Commit df37ba9

Browse files
committed
create new public api level paddle.callbacks;paddle.hub;paddle.utils.unique_name
1 parent 579e5aa commit df37ba9

File tree

6 files changed

+77
-7
lines changed

6 files changed

+77
-7
lines changed

python/paddle/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@
269269

270270
# high-level api
271271
from .hapi import Model # noqa: F401
272-
from .hapi import callbacks # noqa: F401
272+
from . import callbacks # noqa: F401
273273
from .hapi import summary # noqa: F401
274274
from .hapi import flops # noqa: F401
275-
from .hapi import hub # noqa: F401
275+
from . import hub # noqa: F401
276276

277277
import paddle.text # noqa: F401
278278
import paddle.vision # noqa: F401

python/paddle/callbacks.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from .hapi.callbacks import Callback # noqa: F401
16+
from .hapi.callbacks import ProgBarLogger # noqa: F401
17+
from .hapi.callbacks import ModelCheckpoint # noqa: F401
18+
from .hapi.callbacks import VisualDL # noqa: F401
19+
from .hapi.callbacks import LRScheduler # noqa: F401
20+
from .hapi.callbacks import EarlyStopping # noqa: F401
21+
from .hapi.callbacks import ReduceLROnPlateau # noqa: F401
22+
23+
__all__ = [ #noqa
24+
'Callback',
25+
'ProgBarLogger',
26+
'ModelCheckpoint',
27+
'VisualDL',
28+
'LRScheduler',
29+
'EarlyStopping',
30+
'ReduceLROnPlateau'
31+
]

python/paddle/hapi/callbacks.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525

2626
from .progressbar import ProgressBar
2727

28-
__all__ = [
29-
'Callback', 'ProgBarLogger', 'ModelCheckpoint', 'VisualDL', 'LRScheduler',
30-
'EarlyStopping', 'ReduceLROnPlateau'
31-
]
28+
__all__ = []
3229

3330

3431
def config_callbacks(callbacks=None,

python/paddle/hub.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from .hapi.hub import list # noqa: F401
16+
from .hapi.hub import help # noqa: F401
17+
from .hapi.hub import load # noqa: F401
18+
19+
__all__ = [ #noqa
20+
'list', 'help', 'load'
21+
]

python/paddle/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from .lazy_import import try_import # noqa: F401
2020
from .op_version import OpLastCheckpointChecker # noqa: F401
2121
from .install_check import run_check # noqa: F401
22-
from ..fluid.framework import unique_name # noqa: F401
22+
from . import unique_name # noqa: F401
2323
from ..fluid.framework import require_version # noqa: F401
2424

2525
from . import download # noqa: F401

python/paddle/utils/unique_name.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from ..fluid.unique_name import generate # noqa: F401
16+
from ..fluid.unique_name import switch # noqa: F401
17+
from ..fluid.unique_name import guard # noqa: F401
18+
19+
__all__ = [ #noqa
20+
'generate', 'switch', 'guard'
21+
]

0 commit comments

Comments
 (0)