From 11b29d1a8ec1f275786dc55368356e5bec68404e Mon Sep 17 00:00:00 2001 From: zhiboniu Date: Wed, 28 Apr 2021 06:09:32 +0000 Subject: [PATCH] add __all__=[] to python files not in API public list; import * only support in API public list files --- python/paddle/dataset/cifar.py | 2 ++ python/paddle/dataset/common.py | 2 ++ python/paddle/dataset/conll05.py | 2 ++ python/paddle/dataset/flowers.py | 2 ++ python/paddle/dataset/image.py | 2 ++ python/paddle/dataset/imdb.py | 2 ++ python/paddle/dataset/imikolov.py | 2 ++ python/paddle/dataset/mnist.py | 2 ++ python/paddle/dataset/movielens.py | 2 ++ python/paddle/dataset/tests/cifar_test.py | 2 ++ python/paddle/dataset/tests/flowers_test.py | 2 ++ python/paddle/dataset/tests/imdb_test.py | 2 ++ python/paddle/dataset/tests/imikolov_test.py | 2 ++ python/paddle/dataset/tests/mnist_test.py | 2 ++ python/paddle/dataset/tests/test_image.py | 2 ++ python/paddle/dataset/tests/voc2012_test.py | 2 ++ python/paddle/dataset/tests/wmt16_test.py | 2 ++ python/paddle/dataset/uci_housing.py | 2 ++ python/paddle/dataset/voc2012.py | 3 ++- python/paddle/dataset/wmt14.py | 2 ++ python/paddle/dataset/wmt16.py | 2 ++ python/paddle/framework/__init__.py | 2 ++ python/paddle/framework/dtype.py | 7 ++----- python/paddle/framework/framework.py | 2 ++ python/paddle/framework/io.py | 2 ++ python/paddle/framework/random.py | 2 ++ python/paddle/nn/clip.py | 2 ++ python/paddle/nn/decode.py | 2 ++ python/paddle/nn/functional/activation.py | 2 ++ python/paddle/nn/functional/common.py | 2 ++ python/paddle/nn/functional/conv.py | 2 ++ python/paddle/nn/functional/extension.py | 2 ++ python/paddle/nn/functional/input.py | 2 ++ python/paddle/nn/functional/loss.py | 2 ++ python/paddle/nn/functional/norm.py | 2 ++ python/paddle/nn/functional/pooling.py | 2 ++ python/paddle/nn/functional/vision.py | 2 ++ python/paddle/nn/initializer/assign.py | 2 ++ python/paddle/nn/initializer/constant.py | 2 ++ python/paddle/nn/initializer/kaiming.py | 2 ++ python/paddle/nn/initializer/normal.py | 2 ++ python/paddle/nn/initializer/uniform.py | 2 ++ python/paddle/nn/initializer/xavier.py | 2 ++ python/paddle/nn/layer/__init__.py | 2 ++ python/paddle/nn/layer/activation.py | 2 ++ python/paddle/nn/layer/common.py | 2 ++ python/paddle/nn/layer/container.py | 2 +- python/paddle/nn/layer/conv.py | 2 ++ python/paddle/nn/layer/distance.py | 2 ++ python/paddle/nn/layer/loss.py | 2 ++ python/paddle/nn/layer/norm.py | 2 ++ python/paddle/nn/layer/pooling.py | 2 ++ python/paddle/nn/layer/rnn.py | 2 ++ python/paddle/nn/layer/transformer.py | 2 ++ python/paddle/nn/layer/vision.py | 2 ++ python/paddle/nn/utils/weight_norm_hook.py | 2 ++ python/paddle/optimizer/adadelta.py | 2 ++ python/paddle/optimizer/adagrad.py | 2 ++ python/paddle/optimizer/adam.py | 2 ++ python/paddle/optimizer/adamax.py | 2 ++ python/paddle/optimizer/adamw.py | 2 ++ python/paddle/optimizer/lamb.py | 2 ++ python/paddle/optimizer/momentum.py | 2 ++ python/paddle/optimizer/optimizer.py | 2 ++ python/paddle/optimizer/rmsprop.py | 2 ++ python/paddle/optimizer/sgd.py | 2 ++ python/paddle/proto/__init__.py | 2 ++ python/paddle/reader/decorator.py | 2 ++ python/paddle/reader/tests/decorator_test.py | 2 ++ python/paddle/static/input.py | 2 ++ python/paddle/static/io.py | 2 ++ python/paddle/static/nn/common.py | 2 ++ python/paddle/tensor/array.py | 2 ++ python/paddle/tensor/attribute.py | 2 ++ python/paddle/tensor/creation.py | 2 ++ python/paddle/tensor/linalg.py | 2 ++ python/paddle/tensor/logic.py | 2 ++ python/paddle/tensor/manipulation.py | 2 ++ python/paddle/tensor/math.py | 2 ++ python/paddle/tensor/random.py | 2 ++ python/paddle/tensor/search.py | 2 ++ python/paddle/tensor/stat.py | 2 ++ python/paddle/tensor/to_string.py | 2 ++ python/paddle/tests/test_dataset_cifar.py | 2 +- python/paddle/tests/test_dataset_conll05.py | 2 +- python/paddle/tests/test_dataset_imdb.py | 2 +- python/paddle/tests/test_dataset_imikolov.py | 2 +- python/paddle/tests/test_dataset_movielens.py | 2 +- python/paddle/tests/test_dataset_uci_housing.py | 2 +- python/paddle/tests/test_dataset_wmt.py | 2 +- python/paddle/tests/test_datasets.py | 2 +- python/paddle/text/datasets/__init__.py | 2 ++ python/paddle/text/datasets/conll05.py | 2 ++ python/paddle/text/datasets/imdb.py | 2 ++ python/paddle/text/datasets/imikolov.py | 2 ++ python/paddle/text/datasets/movielens.py | 2 ++ python/paddle/text/datasets/uci_housing.py | 2 ++ python/paddle/text/datasets/wmt14.py | 2 ++ python/paddle/text/datasets/wmt16.py | 2 ++ python/paddle/utils/deprecated.py | 2 ++ python/paddle/utils/download.py | 2 ++ python/paddle/utils/image_util.py | 2 ++ python/paddle/utils/install_check.py | 2 ++ python/paddle/utils/lazy_import.py | 2 ++ python/paddle/utils/op_version.py | 2 ++ 105 files changed, 201 insertions(+), 15 deletions(-) diff --git a/python/paddle/dataset/cifar.py b/python/paddle/dataset/cifar.py index a6b6e28c0f5a35..e3d239e2cdf456 100644 --- a/python/paddle/dataset/cifar.py +++ b/python/paddle/dataset/cifar.py @@ -37,6 +37,8 @@ import six from six.moves import cPickle as pickle +__all__ = [] + URL_PREFIX = 'https://dataset.bj.bcebos.com/cifar/' CIFAR10_URL = URL_PREFIX + 'cifar-10-python.tar.gz' CIFAR10_MD5 = 'c58f30108f718f92721af3b95e74349a' diff --git a/python/paddle/dataset/common.py b/python/paddle/dataset/common.py index cff0c6257387c2..2a476f63862cfa 100644 --- a/python/paddle/dataset/common.py +++ b/python/paddle/dataset/common.py @@ -26,6 +26,8 @@ import six.moves.cPickle as pickle import glob +__all__ = [] + HOME = os.path.expanduser('~') DATA_HOME = os.path.join(HOME, '.cache', 'paddle', 'dataset') diff --git a/python/paddle/dataset/conll05.py b/python/paddle/dataset/conll05.py index 96fd5ae7d76c81..65cf04f05b7f04 100644 --- a/python/paddle/dataset/conll05.py +++ b/python/paddle/dataset/conll05.py @@ -30,6 +30,8 @@ import paddle.utils.deprecated as deprecated from six.moves import zip, range +__all__ = [] + DATA_URL = 'http://paddlemodels.bj.bcebos.com/conll05st/conll05st-tests.tar.gz' DATA_MD5 = '387719152ae52d60422c016e92a742fc' WORDDICT_URL = 'http://paddlemodels.bj.bcebos.com/conll05st%2FwordDict.txt' diff --git a/python/paddle/dataset/flowers.py b/python/paddle/dataset/flowers.py index 67ffd8e1ee1eda..3b437a1f074407 100644 --- a/python/paddle/dataset/flowers.py +++ b/python/paddle/dataset/flowers.py @@ -51,6 +51,8 @@ from six.moves import cPickle as pickle from paddle.utils import try_import +__all__ = [] + DATA_URL = 'http://paddlemodels.bj.bcebos.com/flowers/102flowers.tgz' LABEL_URL = 'http://paddlemodels.bj.bcebos.com/flowers/imagelabels.mat' SETID_URL = 'http://paddlemodels.bj.bcebos.com/flowers/setid.mat' diff --git a/python/paddle/dataset/image.py b/python/paddle/dataset/image.py index 31329cd978cb59..c20672c2ce1577 100644 --- a/python/paddle/dataset/image.py +++ b/python/paddle/dataset/image.py @@ -58,6 +58,8 @@ import tarfile import six.moves.cPickle as pickle +__all__ = [] + def _check_cv2(): if cv2 is None: diff --git a/python/paddle/dataset/imdb.py b/python/paddle/dataset/imdb.py index 33ae4405c502b3..9a6c8e837ed461 100644 --- a/python/paddle/dataset/imdb.py +++ b/python/paddle/dataset/imdb.py @@ -30,6 +30,8 @@ import string import six +__all__ = [] + #URL = 'http://ai.stanford.edu/%7Eamaas/data/sentiment/aclImdb_v1.tar.gz' URL = 'https://dataset.bj.bcebos.com/imdb%2FaclImdb_v1.tar.gz' MD5 = '7c2ac02c03563afcf9b574c7e56c153a' diff --git a/python/paddle/dataset/imikolov.py b/python/paddle/dataset/imikolov.py index 3b8b12303c9493..7a4efe27aa9614 100644 --- a/python/paddle/dataset/imikolov.py +++ b/python/paddle/dataset/imikolov.py @@ -27,6 +27,8 @@ import tarfile import six +__all__ = [] + #URL = 'http://www.fit.vutbr.cz/~imikolov/rnnlm/simple-examples.tgz' URL = 'https://dataset.bj.bcebos.com/imikolov%2Fsimple-examples.tgz' MD5 = '30177ea32e27c525793142b6bf2c8e2d' diff --git a/python/paddle/dataset/mnist.py b/python/paddle/dataset/mnist.py index 06e8174a61e803..e4f724bd66d13c 100644 --- a/python/paddle/dataset/mnist.py +++ b/python/paddle/dataset/mnist.py @@ -27,6 +27,8 @@ import struct from six.moves import range +__all__ = [] + URL_PREFIX = 'https://dataset.bj.bcebos.com/mnist/' TEST_IMAGE_URL = URL_PREFIX + 't10k-images-idx3-ubyte.gz' TEST_IMAGE_MD5 = '9fb629c4189551a2d022fa330f9573f3' diff --git a/python/paddle/dataset/movielens.py b/python/paddle/dataset/movielens.py index 23781b65785b10..862ac586bc9643 100644 --- a/python/paddle/dataset/movielens.py +++ b/python/paddle/dataset/movielens.py @@ -34,6 +34,8 @@ import six import paddle.compat as cpt +__all__ = [] + age_table = [1, 18, 25, 35, 45, 50, 56] #URL = 'http://files.grouplens.org/datasets/movielens/ml-1m.zip' diff --git a/python/paddle/dataset/tests/cifar_test.py b/python/paddle/dataset/tests/cifar_test.py index 8e514f0fd9a18a..54dff6b40cf3c1 100644 --- a/python/paddle/dataset/tests/cifar_test.py +++ b/python/paddle/dataset/tests/cifar_test.py @@ -17,6 +17,8 @@ import paddle.dataset.cifar import unittest +__all__ = [] + class TestCIFAR(unittest.TestCase): def check_reader(self, reader): diff --git a/python/paddle/dataset/tests/flowers_test.py b/python/paddle/dataset/tests/flowers_test.py index 06a0a7761cfa10..256c116b7cff65 100644 --- a/python/paddle/dataset/tests/flowers_test.py +++ b/python/paddle/dataset/tests/flowers_test.py @@ -17,6 +17,8 @@ import paddle.dataset.flowers import unittest +__all__ = [] + class TestFlowers(unittest.TestCase): def check_reader(self, reader): diff --git a/python/paddle/dataset/tests/imdb_test.py b/python/paddle/dataset/tests/imdb_test.py index 613c5f8edb289c..264b0f232fa803 100644 --- a/python/paddle/dataset/tests/imdb_test.py +++ b/python/paddle/dataset/tests/imdb_test.py @@ -18,6 +18,8 @@ import unittest import re +__all__ = [] + TRAIN_POS_PATTERN = re.compile(r"aclImdb/train/pos/.*\.txt$") TRAIN_NEG_PATTERN = re.compile(r"aclImdb/train/neg/.*\.txt$") TRAIN_PATTERN = re.compile(r"aclImdb/train/.*\.txt$") diff --git a/python/paddle/dataset/tests/imikolov_test.py b/python/paddle/dataset/tests/imikolov_test.py index 1f78a5dd4d1a09..5556274211fc33 100644 --- a/python/paddle/dataset/tests/imikolov_test.py +++ b/python/paddle/dataset/tests/imikolov_test.py @@ -19,6 +19,8 @@ WORD_DICT = paddle.dataset.imikolov.build_dict() +__all__ = [] + class TestMikolov(unittest.TestCase): def check_reader(self, reader, n): diff --git a/python/paddle/dataset/tests/mnist_test.py b/python/paddle/dataset/tests/mnist_test.py index fbb5d926494e38..238b58244e147a 100644 --- a/python/paddle/dataset/tests/mnist_test.py +++ b/python/paddle/dataset/tests/mnist_test.py @@ -17,6 +17,8 @@ import paddle.dataset.mnist import unittest +__all__ = [] + class TestMNIST(unittest.TestCase): def check_reader(self, reader): diff --git a/python/paddle/dataset/tests/test_image.py b/python/paddle/dataset/tests/test_image.py index 32d2eb17ae673e..259939d62f6413 100644 --- a/python/paddle/dataset/tests/test_image.py +++ b/python/paddle/dataset/tests/test_image.py @@ -19,6 +19,8 @@ import paddle.dataset.image as image +__all__ = [] + class Image(unittest.TestCase): def test_resize_flip_chw(self): diff --git a/python/paddle/dataset/tests/voc2012_test.py b/python/paddle/dataset/tests/voc2012_test.py index cddeb91cab2c0f..21c24e6df823fb 100644 --- a/python/paddle/dataset/tests/voc2012_test.py +++ b/python/paddle/dataset/tests/voc2012_test.py @@ -17,6 +17,8 @@ import paddle.dataset.voc2012 import unittest +__all__ = [] + class TestVOC(unittest.TestCase): def check_reader(self, reader): diff --git a/python/paddle/dataset/tests/wmt16_test.py b/python/paddle/dataset/tests/wmt16_test.py index be121bb1012196..68a9819c8f3350 100644 --- a/python/paddle/dataset/tests/wmt16_test.py +++ b/python/paddle/dataset/tests/wmt16_test.py @@ -17,6 +17,8 @@ import paddle.dataset.wmt16 import unittest +__all__ = [] + class TestWMT16(unittest.TestCase): def checkout_one_sample(self, sample): diff --git a/python/paddle/dataset/uci_housing.py b/python/paddle/dataset/uci_housing.py index 1bc2098350f533..0ac65f0fda46b8 100644 --- a/python/paddle/dataset/uci_housing.py +++ b/python/paddle/dataset/uci_housing.py @@ -29,6 +29,8 @@ import paddle.dataset.common import paddle.utils.deprecated as deprecated +__all__ = [] + URL = 'http://paddlemodels.bj.bcebos.com/uci_housing/housing.data' MD5 = 'd4accdce7a25600298819f8e28e8d593' feature_names = [ diff --git a/python/paddle/dataset/voc2012.py b/python/paddle/dataset/voc2012.py index 1575b44cd1677e..5784e739b418e1 100644 --- a/python/paddle/dataset/voc2012.py +++ b/python/paddle/dataset/voc2012.py @@ -25,10 +25,11 @@ import io import numpy as np from paddle.dataset.common import download -from paddle.dataset.image import * import paddle.utils.deprecated as deprecated from PIL import Image +__all__ = [] + VOC_URL = 'http://host.robots.ox.ac.uk/pascal/VOC/voc2012/\ VOCtrainval_11-May-2012.tar' diff --git a/python/paddle/dataset/wmt14.py b/python/paddle/dataset/wmt14.py index 818f4b28ba143f..c842ceaa091333 100644 --- a/python/paddle/dataset/wmt14.py +++ b/python/paddle/dataset/wmt14.py @@ -30,6 +30,8 @@ import paddle.compat as cpt import paddle.utils.deprecated as deprecated +__all__ = [] + URL_DEV_TEST = ('http://www-lium.univ-lemans.fr/~schwenk/' 'cslm_joint_paper/data/dev+test.tgz') MD5_DEV_TEST = '7d7897317ddd8ba0ae5c5fa7248d3ff5' diff --git a/python/paddle/dataset/wmt16.py b/python/paddle/dataset/wmt16.py index 6804e7ab5fc33b..320ef139f7700c 100644 --- a/python/paddle/dataset/wmt16.py +++ b/python/paddle/dataset/wmt16.py @@ -40,6 +40,8 @@ import paddle.compat as cpt import paddle.utils.deprecated as deprecated +__all__ = [] + DATA_URL = ("http://paddlemodels.bj.bcebos.com/wmt/wmt16.tar.gz") DATA_MD5 = "0c38be43600334966403524a40dcd81e" diff --git a/python/paddle/framework/__init__.py b/python/paddle/framework/__init__.py index 660267c24e57ee..ce84fb739c0009 100644 --- a/python/paddle/framework/__init__.py +++ b/python/paddle/framework/__init__.py @@ -34,3 +34,5 @@ from .io import save # noqa: F401 from .io import load # noqa: F401 from ..fluid.dygraph.parallel import DataParallel # noqa: F401 + +__all__ = [] diff --git a/python/paddle/framework/dtype.py b/python/paddle/framework/dtype.py index 3eeaa6e74ecebd..f49f748975882d 100644 --- a/python/paddle/framework/dtype.py +++ b/python/paddle/framework/dtype.py @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__all__ = [ - "dtype", "uint8", "int8", "int16", "int32", "int64", "bfloat16", "float16", - "float32", "float64", "complex64", "complex128", "bool" -] - from ..fluid.core import VarDesc dtype = VarDesc.VarType @@ -38,3 +33,5 @@ complex128 = VarDesc.VarType.COMPLEX128 bool = VarDesc.VarType.BOOL + +__all__ = [] diff --git a/python/paddle/framework/framework.py b/python/paddle/framework/framework.py index f50285010cc5de..17eaa82cd8b6a0 100644 --- a/python/paddle/framework/framework.py +++ b/python/paddle/framework/framework.py @@ -19,6 +19,8 @@ import numpy as np from contextlib import contextmanager +__all__ = [] + def set_default_dtype(d): """ diff --git a/python/paddle/framework/io.py b/python/paddle/framework/io.py index ac0e172d49d541..493574c5bef47a 100644 --- a/python/paddle/framework/io.py +++ b/python/paddle/framework/io.py @@ -38,6 +38,8 @@ from paddle.fluid.dygraph.io import _construct_program_holders, _construct_params_and_buffers from paddle.fluid.dygraph.io import INFER_MODEL_SUFFIX, INFER_PARAMS_SUFFIX, INFER_PARAMS_INFO_SUFFIX +__all__ = [] + def _build_saved_state_dict(state_dict): save_dict = {} diff --git a/python/paddle/framework/random.py b/python/paddle/framework/random.py index 251a8407035fdc..701f8b5352c3d4 100644 --- a/python/paddle/framework/random.py +++ b/python/paddle/framework/random.py @@ -16,6 +16,8 @@ import paddle.fluid as fluid from paddle.fluid import core +__all__ = [] + def seed(seed): """ diff --git a/python/paddle/nn/clip.py b/python/paddle/nn/clip.py index 70c49b4a53876d..e868cbdbacc171 100644 --- a/python/paddle/nn/clip.py +++ b/python/paddle/nn/clip.py @@ -16,3 +16,5 @@ from ..fluid.clip import ClipGradByGlobalNorm # noqa: F401 from ..fluid.clip import ClipGradByNorm # noqa: F401 from ..fluid.clip import ClipGradByValue # noqa: F401 + +__all__ = [] diff --git a/python/paddle/nn/decode.py b/python/paddle/nn/decode.py index 3229f0b21a6699..ff4a6e4f482af5 100644 --- a/python/paddle/nn/decode.py +++ b/python/paddle/nn/decode.py @@ -14,3 +14,5 @@ from ..fluid.layers import BeamSearchDecoder # noqa: F401 from ..fluid.layers import dynamic_decode # noqa: F401 + +__all__ = [] diff --git a/python/paddle/nn/functional/activation.py b/python/paddle/nn/functional/activation.py index cd8ee99baa2374..9001ba16b7ac2d 100644 --- a/python/paddle/nn/functional/activation.py +++ b/python/paddle/nn/functional/activation.py @@ -27,6 +27,8 @@ from ...fluid.data_feeder import check_variable_and_dtype, check_dtype import paddle +__all__ = [] + def elu(x, alpha=1.0, name=None): r""" diff --git a/python/paddle/nn/functional/common.py b/python/paddle/nn/functional/common.py index 7379c7a5f67bd0..65b9c6771c4f19 100644 --- a/python/paddle/nn/functional/common.py +++ b/python/paddle/nn/functional/common.py @@ -34,6 +34,8 @@ from ...fluid import core, layers from ...fluid.data_feeder import check_variable_and_dtype +__all__ = [] + def interpolate(x, size=None, diff --git a/python/paddle/nn/functional/conv.py b/python/paddle/nn/functional/conv.py index 800c8204973723..1edbc5f462ecd7 100644 --- a/python/paddle/nn/functional/conv.py +++ b/python/paddle/nn/functional/conv.py @@ -22,6 +22,8 @@ from ...fluid.param_attr import ParamAttr from ...fluid.layer_helper import LayerHelper +__all__ = [] + def _is_list_or_tuple(input): return isinstance(input, (list, tuple)) diff --git a/python/paddle/nn/functional/extension.py b/python/paddle/nn/functional/extension.py index 7900f903e7fd2f..8a9597119ab8df 100644 --- a/python/paddle/nn/functional/extension.py +++ b/python/paddle/nn/functional/extension.py @@ -23,6 +23,8 @@ from ...fluid.layers.layer_function_generator import templatedoc from ...fluid.layers.sequence_lod import sequence_mask +__all__ = [] + def diag_embed(input, offset=0, dim1=-2, dim2=-1): """ diff --git a/python/paddle/nn/functional/input.py b/python/paddle/nn/functional/input.py index 4fff9cda4be33a..67dc69c1a93b69 100644 --- a/python/paddle/nn/functional/input.py +++ b/python/paddle/nn/functional/input.py @@ -19,6 +19,8 @@ from ...fluid.layers import core from ...fluid.data_feeder import check_variable_and_dtype, check_dtype +__all__ = [] + def one_hot(x, num_classes, name=None): """ diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index bb2d8005f4e318..31ffb91f30dca9 100755 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -39,6 +39,8 @@ from ...fluid.framework import Variable from paddle.utils import deprecated +__all__ = [] + def binary_cross_entropy(input, label, weight=None, reduction='mean', name=None): diff --git a/python/paddle/nn/functional/norm.py b/python/paddle/nn/functional/norm.py index dddc4c66d591cc..20e3254638997c 100644 --- a/python/paddle/nn/functional/norm.py +++ b/python/paddle/nn/functional/norm.py @@ -24,6 +24,8 @@ from ...fluid import core, dygraph_utils import numbers +__all__ = [] + def normalize(x, p=2, axis=1, epsilon=1e-12, name=None): r""" diff --git a/python/paddle/nn/functional/pooling.py b/python/paddle/nn/functional/pooling.py index 27a66c629cafaa..1869ac15b17a3b 100755 --- a/python/paddle/nn/functional/pooling.py +++ b/python/paddle/nn/functional/pooling.py @@ -18,6 +18,8 @@ from ...fluid.layers import utils, LayerHelper, unsqueeze, squeeze from ...fluid.data_feeder import check_type, check_variable_and_dtype +__all__ = [] + def _is_list_or_tuple(input): return isinstance(input, (list, tuple)) diff --git a/python/paddle/nn/functional/vision.py b/python/paddle/nn/functional/vision.py index cb8a817023d22c..55a66e70160b6c 100644 --- a/python/paddle/nn/functional/vision.py +++ b/python/paddle/nn/functional/vision.py @@ -19,6 +19,8 @@ from ...fluid import dygraph_utils import numpy as np +__all__ = [] + def affine_grid(theta, out_shape, align_corners=True, name=None): """ diff --git a/python/paddle/nn/initializer/assign.py b/python/paddle/nn/initializer/assign.py index 642919f3540753..13a70a179ffe38 100644 --- a/python/paddle/nn/initializer/assign.py +++ b/python/paddle/nn/initializer/assign.py @@ -19,6 +19,8 @@ from ...fluid.data_feeder import check_type from ...fluid.initializer import NumpyArrayInitializer +__all__ = [] + class Assign(NumpyArrayInitializer): """Init an parameter with a numpy array, list, or tensor. diff --git a/python/paddle/nn/initializer/constant.py b/python/paddle/nn/initializer/constant.py index aec3e82aab62b7..292eaff362b407 100644 --- a/python/paddle/nn/initializer/constant.py +++ b/python/paddle/nn/initializer/constant.py @@ -15,6 +15,8 @@ # TODO: define the initializers of Constant in neural network from ...fluid.initializer import ConstantInitializer +__all__ = [] + class Constant(ConstantInitializer): """Implement the constant initializer. diff --git a/python/paddle/nn/initializer/kaiming.py b/python/paddle/nn/initializer/kaiming.py index 712bffccda102f..f0847c85237b25 100644 --- a/python/paddle/nn/initializer/kaiming.py +++ b/python/paddle/nn/initializer/kaiming.py @@ -15,6 +15,8 @@ # TODO: define the initializers of Kaiming functions in neural network from ...fluid.initializer import MSRAInitializer +__all__ = [] + class KaimingNormal(MSRAInitializer): r"""Implements the Kaiming Normal initializer diff --git a/python/paddle/nn/initializer/normal.py b/python/paddle/nn/initializer/normal.py index c009df780054ed..6fee5058057cb0 100644 --- a/python/paddle/nn/initializer/normal.py +++ b/python/paddle/nn/initializer/normal.py @@ -15,6 +15,8 @@ from ...fluid.initializer import NormalInitializer from ...fluid.initializer import TruncatedNormalInitializer +__all__ = [] + class Normal(NormalInitializer): """The Random Normal (Gaussian) distribution initializer. diff --git a/python/paddle/nn/initializer/uniform.py b/python/paddle/nn/initializer/uniform.py index e54a4d2187b8d7..cac03b59480712 100644 --- a/python/paddle/nn/initializer/uniform.py +++ b/python/paddle/nn/initializer/uniform.py @@ -14,6 +14,8 @@ from ...fluid.initializer import UniformInitializer +__all__ = [] + class Uniform(UniformInitializer): """The random uniform distribution initializer. diff --git a/python/paddle/nn/initializer/xavier.py b/python/paddle/nn/initializer/xavier.py index 01a4a8887b489a..f2d5593032f64d 100644 --- a/python/paddle/nn/initializer/xavier.py +++ b/python/paddle/nn/initializer/xavier.py @@ -14,6 +14,8 @@ from ...fluid.initializer import XavierInitializer +__all__ = [] + class XavierNormal(XavierInitializer): r""" diff --git a/python/paddle/nn/layer/__init__.py b/python/paddle/nn/layer/__init__.py index 64f0391fb6533e..10c2b1e3056f15 100644 --- a/python/paddle/nn/layer/__init__.py +++ b/python/paddle/nn/layer/__init__.py @@ -81,3 +81,5 @@ from .vision import PixelShuffle # noqa: F401 from .distance import PairwiseDistance # noqa: F401 from .container import LayerDict # noqa: F401 + +__all__ = [] diff --git a/python/paddle/nn/layer/activation.py b/python/paddle/nn/layer/activation.py index c6ce4588ea5dab..d5b37144cfffed 100644 --- a/python/paddle/nn/layer/activation.py +++ b/python/paddle/nn/layer/activation.py @@ -22,6 +22,8 @@ from paddle.framework import get_default_dtype from .. import functional as F +__all__ = [] + class ELU(layers.Layer): r""" diff --git a/python/paddle/nn/layer/common.py b/python/paddle/nn/layer/common.py index 058507ba5dec36..f608f20feef55e 100644 --- a/python/paddle/nn/layer/common.py +++ b/python/paddle/nn/layer/common.py @@ -20,6 +20,8 @@ from .. import functional as F from ...fluid.framework import _dygraph_tracer +__all__ = [] + def _npairs(x, n): if isinstance(x, (paddle.Tensor, list)): diff --git a/python/paddle/nn/layer/container.py b/python/paddle/nn/layer/container.py index db317839ae818a..ad41535f44ad6a 100644 --- a/python/paddle/nn/layer/container.py +++ b/python/paddle/nn/layer/container.py @@ -16,7 +16,7 @@ from ...fluid.dygraph.layers import Layer from six.moves import collections_abc -__all__ = ['LayerDict', ] +__all__ = [] class LayerDict(Layer): diff --git a/python/paddle/nn/layer/conv.py b/python/paddle/nn/layer/conv.py index 2360dc17cf1710..2de065d62a4f8c 100644 --- a/python/paddle/nn/layer/conv.py +++ b/python/paddle/nn/layer/conv.py @@ -25,6 +25,8 @@ from ...fluid.layers import utils from ..functional.conv import _update_padding_nd +__all__ = [] + def _get_default_param_initializer(num_channels, filter_size): filter_elem_num = num_channels * np.prod(filter_size) diff --git a/python/paddle/nn/layer/distance.py b/python/paddle/nn/layer/distance.py index 7eb0fc1fbb5755..77e3447ffda00e 100644 --- a/python/paddle/nn/layer/distance.py +++ b/python/paddle/nn/layer/distance.py @@ -20,6 +20,8 @@ from ...fluid.data_feeder import check_variable_and_dtype, check_type from ...fluid.layer_helper import LayerHelper +__all__ = [] + class PairwiseDistance(layers.Layer): r""" diff --git a/python/paddle/nn/layer/loss.py b/python/paddle/nn/layer/loss.py index 356b22c632cf51..8f43eb8866b4bb 100644 --- a/python/paddle/nn/layer/loss.py +++ b/python/paddle/nn/layer/loss.py @@ -21,6 +21,8 @@ from .. import functional as F from paddle.fluid.framework import core, in_dygraph_mode, _varbase_creator +__all__ = [] + class BCEWithLogitsLoss(fluid.dygraph.Layer): r""" diff --git a/python/paddle/nn/layer/norm.py b/python/paddle/nn/layer/norm.py index 970d68e8263432..45640a6598e576 100644 --- a/python/paddle/nn/layer/norm.py +++ b/python/paddle/nn/layer/norm.py @@ -50,6 +50,8 @@ from ...fluid.dygraph.base import no_grad from .. import functional as F +__all__ = [] + class _InstanceNormBase(layers.Layer): """ diff --git a/python/paddle/nn/layer/pooling.py b/python/paddle/nn/layer/pooling.py index 5916fd7c69eb0b..528572ee21b7cc 100755 --- a/python/paddle/nn/layer/pooling.py +++ b/python/paddle/nn/layer/pooling.py @@ -16,6 +16,8 @@ from ...fluid.layer_helper import LayerHelper from .. import functional as F +__all__ = [] + class AvgPool1D(layers.Layer): r""" diff --git a/python/paddle/nn/layer/rnn.py b/python/paddle/nn/layer/rnn.py index a7539b5b09571c..de9b8cdbfce2a1 100644 --- a/python/paddle/nn/layer/rnn.py +++ b/python/paddle/nn/layer/rnn.py @@ -33,6 +33,8 @@ from paddle.fluid.layers.utils import map_structure, flatten, pack_sequence_as from paddle.fluid.data_feeder import convert_dtype +__all__ = [] + def split_states(states, bidirectional=False, state_components=1): r""" diff --git a/python/paddle/nn/layer/transformer.py b/python/paddle/nn/layer/transformer.py index 752870f3d0a28b..891177532a4389 100644 --- a/python/paddle/nn/layer/transformer.py +++ b/python/paddle/nn/layer/transformer.py @@ -28,6 +28,8 @@ from ...fluid.param_attr import ParamAttr from ...fluid.data_feeder import convert_dtype +__all__ = [] + def _convert_param_attr_to_list(param_attr, n): """ diff --git a/python/paddle/nn/layer/vision.py b/python/paddle/nn/layer/vision.py index e66e122be5259a..e6d3af9a37b329 100644 --- a/python/paddle/nn/layer/vision.py +++ b/python/paddle/nn/layer/vision.py @@ -17,6 +17,8 @@ from ...fluid.dygraph import layers from .. import functional +__all__ = [] + class PixelShuffle(layers.Layer): """ diff --git a/python/paddle/nn/utils/weight_norm_hook.py b/python/paddle/nn/utils/weight_norm_hook.py index 23df38ca08c45a..8d2cc8062d2ccb 100755 --- a/python/paddle/nn/utils/weight_norm_hook.py +++ b/python/paddle/nn/utils/weight_norm_hook.py @@ -19,6 +19,8 @@ from ...fluid.layer_helper import LayerHelper from ...fluid.data_feeder import check_variable_and_dtype +__all__ = [] + def l2_norm(x, axis, epsilon=1e-12, name=None): if len(x.shape) == 1: diff --git a/python/paddle/optimizer/adadelta.py b/python/paddle/optimizer/adadelta.py index af07d706e135d1..6c10d9bc2690a0 100644 --- a/python/paddle/optimizer/adadelta.py +++ b/python/paddle/optimizer/adadelta.py @@ -17,6 +17,8 @@ from ..fluid import framework from ..fluid.framework import Variable, name_scope +__all__ = [] + class Adadelta(Optimizer): r""" diff --git a/python/paddle/optimizer/adagrad.py b/python/paddle/optimizer/adagrad.py index 82615c92b7cfe1..bb934e5a9262c7 100644 --- a/python/paddle/optimizer/adagrad.py +++ b/python/paddle/optimizer/adagrad.py @@ -17,6 +17,8 @@ from ..fluid import framework from ..fluid.framework import Variable +__all__ = [] + class Adagrad(Optimizer): r""" diff --git a/python/paddle/optimizer/adam.py b/python/paddle/optimizer/adam.py index 358fa8fb97d7e3..63ca462d1a26b8 100644 --- a/python/paddle/optimizer/adam.py +++ b/python/paddle/optimizer/adam.py @@ -24,6 +24,8 @@ import paddle +__all__ = [] + class Adam(Optimizer): r""" diff --git a/python/paddle/optimizer/adamax.py b/python/paddle/optimizer/adamax.py index 175d932540deee..44ae89f49d1c05 100644 --- a/python/paddle/optimizer/adamax.py +++ b/python/paddle/optimizer/adamax.py @@ -17,6 +17,8 @@ from ..fluid import framework from ..fluid.framework import Variable, name_scope +__all__ = [] + class Adamax(Optimizer): r""" diff --git a/python/paddle/optimizer/adamw.py b/python/paddle/optimizer/adamw.py index 899c2957a6a4f8..304f0b771826c9 100644 --- a/python/paddle/optimizer/adamw.py +++ b/python/paddle/optimizer/adamw.py @@ -19,6 +19,8 @@ from ..fluid.dygraph import base as imperative_base import paddle +__all__ = [] + class AdamW(Adam): r""" diff --git a/python/paddle/optimizer/lamb.py b/python/paddle/optimizer/lamb.py index bab130ec590989..bff24e71c81536 100644 --- a/python/paddle/optimizer/lamb.py +++ b/python/paddle/optimizer/lamb.py @@ -17,6 +17,8 @@ from ..fluid import framework from ..fluid.framework import Variable +__all__ = [] + class Lamb(Optimizer): r""" diff --git a/python/paddle/optimizer/momentum.py b/python/paddle/optimizer/momentum.py index c1dc0e8ddd8af5..372143553e0c39 100644 --- a/python/paddle/optimizer/momentum.py +++ b/python/paddle/optimizer/momentum.py @@ -22,6 +22,8 @@ import paddle.fluid as fluid from paddle.fluid.regularizer import L2DecayRegularizer +__all__ = [] + class Momentum(Optimizer): r""" diff --git a/python/paddle/optimizer/optimizer.py b/python/paddle/optimizer/optimizer.py index 9425ab1431e70b..b06bd2a2b0be95 100644 --- a/python/paddle/optimizer/optimizer.py +++ b/python/paddle/optimizer/optimizer.py @@ -42,6 +42,8 @@ from .. import compat as cpt from .lr import LRScheduler +__all__ = [] + class Optimizer(object): r"""Optimizer Base class. diff --git a/python/paddle/optimizer/rmsprop.py b/python/paddle/optimizer/rmsprop.py index a2fd40bc0b3699..b0bb0228c8ca82 100644 --- a/python/paddle/optimizer/rmsprop.py +++ b/python/paddle/optimizer/rmsprop.py @@ -17,6 +17,8 @@ from ..fluid import framework from ..fluid.framework import Variable +__all__ = [] + class RMSProp(Optimizer): r""" diff --git a/python/paddle/optimizer/sgd.py b/python/paddle/optimizer/sgd.py index ecac40aec72983..4526034b405b0c 100644 --- a/python/paddle/optimizer/sgd.py +++ b/python/paddle/optimizer/sgd.py @@ -18,6 +18,8 @@ from ..fluid.framework import Variable, name_scope from ..fluid.dygraph import no_grad +__all__ = [] + class SGD(Optimizer): r""" diff --git a/python/paddle/proto/__init__.py b/python/paddle/proto/__init__.py index 07406a841ec90a..f482d80548de13 100644 --- a/python/paddle/proto/__init__.py +++ b/python/paddle/proto/__init__.py @@ -14,3 +14,5 @@ from paddle.proto.TrainerConfig_pb2 import OptimizationConfig, TrainerConfig from paddle.proto.ModelConfig_pb2 import ModelConfig + +__all__ = [] diff --git a/python/paddle/reader/decorator.py b/python/paddle/reader/decorator.py index 0aefcf9e683da0..3129029d829209 100644 --- a/python/paddle/reader/decorator.py +++ b/python/paddle/reader/decorator.py @@ -27,6 +27,8 @@ import zlib import paddle.compat as cpt +__all__ = [] + # On macOS, the 'spawn' start method is now the default in Python3.8 multiprocessing, # Paddle is currently unable to solve this, so forces the process to start using # the 'fork' start method. diff --git a/python/paddle/reader/tests/decorator_test.py b/python/paddle/reader/tests/decorator_test.py index e15702e39c458e..e11600a06fb9e9 100644 --- a/python/paddle/reader/tests/decorator_test.py +++ b/python/paddle/reader/tests/decorator_test.py @@ -19,6 +19,8 @@ import paddle.reader +__all__ = [] + def reader_creator_10(dur): def reader(): diff --git a/python/paddle/static/input.py b/python/paddle/static/input.py index c1de576ee74c9e..f06c45cc369737 100644 --- a/python/paddle/static/input.py +++ b/python/paddle/static/input.py @@ -21,6 +21,8 @@ from paddle.fluid.framework import convert_np_dtype_to_dtype_ from paddle.fluid.framework import static_only +__all__ = [] + @static_only def data(name, shape, dtype=None, lod_level=0): diff --git a/python/paddle/static/io.py b/python/paddle/static/io.py index fc6d8b64f18cb3..58e8ebc481d799 100644 --- a/python/paddle/static/io.py +++ b/python/paddle/static/io.py @@ -37,6 +37,8 @@ from paddle.fluid.executor import Executor, global_scope from paddle.fluid.log_helper import get_logger +__all__ = [] + _logger = get_logger( __name__, logging.INFO, fmt='%(asctime)s-%(levelname)s: %(message)s') diff --git a/python/paddle/static/nn/common.py b/python/paddle/static/nn/common.py index 659b7f45b26a7a..b8133872aa934c 100755 --- a/python/paddle/static/nn/common.py +++ b/python/paddle/static/nn/common.py @@ -15,6 +15,8 @@ import paddle from paddle.fluid.framework import static_only +__all__ = [] + @static_only def fc(x, diff --git a/python/paddle/tensor/array.py b/python/paddle/tensor/array.py index ee28d47a9a9fd5..6c3d5c577e7452 100644 --- a/python/paddle/tensor/array.py +++ b/python/paddle/tensor/array.py @@ -16,6 +16,8 @@ from ..fluid import layers +__all__ = [] + def array_length(array): """ diff --git a/python/paddle/tensor/attribute.py b/python/paddle/tensor/attribute.py index 1f709ac4dbc862..131afca0d676da 100644 --- a/python/paddle/tensor/attribute.py +++ b/python/paddle/tensor/attribute.py @@ -22,6 +22,8 @@ from ..fluid.layers import rank # noqa: F401 from ..fluid.layers import shape # noqa: F401 +__all__ = [] + def _complex_to_real_dtype(dtype): if dtype == core.VarDesc.VarType.COMPLEX64: diff --git a/python/paddle/tensor/creation.py b/python/paddle/tensor/creation.py index b31984f684695f..361c0e80f90d7d 100644 --- a/python/paddle/tensor/creation.py +++ b/python/paddle/tensor/creation.py @@ -31,6 +31,8 @@ from ..fluid.layers import linspace # noqa: F401 import paddle +__all__ = [] + @dygraph_only def to_tensor(data, dtype=None, place=None, stop_gradient=True): diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index 87e3bce4b1d698..8aa9c9bd2bd7f9 100644 --- a/python/paddle/tensor/linalg.py +++ b/python/paddle/tensor/linalg.py @@ -21,6 +21,8 @@ from paddle.common_ops_import import core from paddle.common_ops_import import VarDesc +__all__ = [] + def matmul(x, y, transpose_x=False, transpose_y=False, name=None): """ diff --git a/python/paddle/tensor/logic.py b/python/paddle/tensor/logic.py index 14154fb06f83ee..bdf2c477d86588 100644 --- a/python/paddle/tensor/logic.py +++ b/python/paddle/tensor/logic.py @@ -28,6 +28,8 @@ from paddle.common_ops_import import core +__all__ = [] + def equal_all(x, y, name=None): """ diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index dc811ea0f3fa6d..1a5962042675d2 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -34,6 +34,8 @@ import paddle import warnings +__all__ = [] + def _print_warning_in_static_mode(api_name): warnings.warn( diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 65f57b4b4e93ba..84c67a9ae8d9dc 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -59,6 +59,8 @@ from ..fluid.layers import multiplex # noqa: F401 from ..fluid import layers +__all__ = [] + _supported_int_dtype_ = [ VarDesc.VarType.UINT8, VarDesc.VarType.INT8, diff --git a/python/paddle/tensor/random.py b/python/paddle/tensor/random.py index 7e1eef8f325087..69a46345447633 100644 --- a/python/paddle/tensor/random.py +++ b/python/paddle/tensor/random.py @@ -21,6 +21,8 @@ from ..fluid.layers import utils import paddle +__all__ = [] + def bernoulli(x, name=None): """ diff --git a/python/paddle/tensor/search.py b/python/paddle/tensor/search.py index ac303d2311eb99..3d8a75f9277af1 100644 --- a/python/paddle/tensor/search.py +++ b/python/paddle/tensor/search.py @@ -25,6 +25,8 @@ # from ..fluid.layers import has_inf #DEFINE_ALIAS # from ..fluid.layers import has_nan #DEFINE_ALIAS +__all__ = [] + def argsort(x, axis=-1, descending=False, name=None): """ diff --git a/python/paddle/tensor/stat.py b/python/paddle/tensor/stat.py index fa7a278a2b52c2..8c74360a17d05b 100644 --- a/python/paddle/tensor/stat.py +++ b/python/paddle/tensor/stat.py @@ -23,6 +23,8 @@ from ..fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype import paddle +__all__ = [] + def mean(x, axis=None, keepdim=False, name=None): """ diff --git a/python/paddle/tensor/to_string.py b/python/paddle/tensor/to_string.py index 2e76a8d47a7738..9d07840be68825 100644 --- a/python/paddle/tensor/to_string.py +++ b/python/paddle/tensor/to_string.py @@ -17,6 +17,8 @@ from paddle.fluid.layers import core from paddle.fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype +__all__ = [] + class PrintOptions(object): precision = 8 diff --git a/python/paddle/tests/test_dataset_cifar.py b/python/paddle/tests/test_dataset_cifar.py index e84f73188666aa..abf79fb1e3974c 100644 --- a/python/paddle/tests/test_dataset_cifar.py +++ b/python/paddle/tests/test_dataset_cifar.py @@ -15,7 +15,7 @@ import unittest import numpy as np -from paddle.vision.datasets import * +from paddle.vision.datasets import Cifar10, Cifar100 class TestCifar10Train(unittest.TestCase): diff --git a/python/paddle/tests/test_dataset_conll05.py b/python/paddle/tests/test_dataset_conll05.py index e35c04275d2047..9eb0036718b355 100644 --- a/python/paddle/tests/test_dataset_conll05.py +++ b/python/paddle/tests/test_dataset_conll05.py @@ -16,7 +16,7 @@ import unittest import numpy as np -from paddle.text.datasets import * +from paddle.text.datasets import Conll05st class TestConll05st(unittest.TestCase): diff --git a/python/paddle/tests/test_dataset_imdb.py b/python/paddle/tests/test_dataset_imdb.py index 62c75ab232c8db..aed8c387409dce 100644 --- a/python/paddle/tests/test_dataset_imdb.py +++ b/python/paddle/tests/test_dataset_imdb.py @@ -15,7 +15,7 @@ import unittest import numpy as np -from paddle.text.datasets import * +from paddle.text.datasets import Imdb class TestImdbTrain(unittest.TestCase): diff --git a/python/paddle/tests/test_dataset_imikolov.py b/python/paddle/tests/test_dataset_imikolov.py index f4f0b8e4836772..6ffeeda73c362c 100644 --- a/python/paddle/tests/test_dataset_imikolov.py +++ b/python/paddle/tests/test_dataset_imikolov.py @@ -15,7 +15,7 @@ import unittest import numpy as np -from paddle.text.datasets import * +from paddle.text.datasets import Imikolov class TestImikolovTrain(unittest.TestCase): diff --git a/python/paddle/tests/test_dataset_movielens.py b/python/paddle/tests/test_dataset_movielens.py index 3b61fd6f5c7c22..e5c6d8376eed97 100644 --- a/python/paddle/tests/test_dataset_movielens.py +++ b/python/paddle/tests/test_dataset_movielens.py @@ -15,7 +15,7 @@ import unittest import numpy as np -from paddle.text.datasets import * +from paddle.text.datasets import Movielens class TestMovielensTrain(unittest.TestCase): diff --git a/python/paddle/tests/test_dataset_uci_housing.py b/python/paddle/tests/test_dataset_uci_housing.py index 623c7d24d09da7..bdf960b4336872 100644 --- a/python/paddle/tests/test_dataset_uci_housing.py +++ b/python/paddle/tests/test_dataset_uci_housing.py @@ -19,7 +19,7 @@ import shutil import cv2 -from paddle.text.datasets import * +from paddle.text.datasets import UCIHousing, WMT14 class TestUCIHousingTrain(unittest.TestCase): diff --git a/python/paddle/tests/test_dataset_wmt.py b/python/paddle/tests/test_dataset_wmt.py index b4945cb90f991e..3e63090c9f0fff 100644 --- a/python/paddle/tests/test_dataset_wmt.py +++ b/python/paddle/tests/test_dataset_wmt.py @@ -15,7 +15,7 @@ import unittest import numpy as np -from paddle.text.datasets import * +from paddle.text.datasets import WMT14, WMT16 class TestWMT14Train(unittest.TestCase): diff --git a/python/paddle/tests/test_datasets.py b/python/paddle/tests/test_datasets.py index 89fa01cbceb45c..c93bac3ac27e85 100644 --- a/python/paddle/tests/test_datasets.py +++ b/python/paddle/tests/test_datasets.py @@ -20,7 +20,7 @@ import cv2 import paddle.vision.transforms as T -from paddle.vision.datasets import * +from paddle.vision.datasets import DatasetFolder, ImageFolder, MNIST, FashionMNIST, Flowers from paddle.dataset.common import _check_exists_and_download diff --git a/python/paddle/text/datasets/__init__.py b/python/paddle/text/datasets/__init__.py index 9a00081469a8b0..118917049928bf 100644 --- a/python/paddle/text/datasets/__init__.py +++ b/python/paddle/text/datasets/__init__.py @@ -19,3 +19,5 @@ from .uci_housing import UCIHousing # noqa: F401 from .wmt14 import WMT14 # noqa: F401 from .wmt16 import WMT16 # noqa: F401 + +__all__ = [] diff --git a/python/paddle/text/datasets/conll05.py b/python/paddle/text/datasets/conll05.py index 070c787db85748..7dd29637706f32 100644 --- a/python/paddle/text/datasets/conll05.py +++ b/python/paddle/text/datasets/conll05.py @@ -24,6 +24,8 @@ import paddle.compat as cpt from paddle.dataset.common import _check_exists_and_download +__all__ = [] + DATA_URL = 'http://paddlemodels.bj.bcebos.com/conll05st/conll05st-tests.tar.gz' DATA_MD5 = '387719152ae52d60422c016e92a742fc' WORDDICT_URL = 'http://paddlemodels.bj.bcebos.com/conll05st%2FwordDict.txt' diff --git a/python/paddle/text/datasets/imdb.py b/python/paddle/text/datasets/imdb.py index c64890dc43d77b..f4fe7eb174bb75 100644 --- a/python/paddle/text/datasets/imdb.py +++ b/python/paddle/text/datasets/imdb.py @@ -24,6 +24,8 @@ from paddle.io import Dataset from paddle.dataset.common import _check_exists_and_download +__all__ = [] + URL = 'https://dataset.bj.bcebos.com/imdb%2FaclImdb_v1.tar.gz' MD5 = '7c2ac02c03563afcf9b574c7e56c153a' diff --git a/python/paddle/text/datasets/imikolov.py b/python/paddle/text/datasets/imikolov.py index 7e4daf731a23a1..9c84669d6b8d8d 100644 --- a/python/paddle/text/datasets/imikolov.py +++ b/python/paddle/text/datasets/imikolov.py @@ -22,6 +22,8 @@ from paddle.io import Dataset from paddle.dataset.common import _check_exists_and_download +__all__ = [] + URL = 'https://dataset.bj.bcebos.com/imikolov%2Fsimple-examples.tgz' MD5 = '30177ea32e27c525793142b6bf2c8e2d' diff --git a/python/paddle/text/datasets/movielens.py b/python/paddle/text/datasets/movielens.py index 7741e82194ca7e..798a7c590e17b6 100644 --- a/python/paddle/text/datasets/movielens.py +++ b/python/paddle/text/datasets/movielens.py @@ -26,6 +26,8 @@ import paddle.compat as cpt from paddle.dataset.common import _check_exists_and_download +__all__ = [] + age_table = [1, 18, 25, 35, 45, 50, 56] URL = 'https://dataset.bj.bcebos.com/movielens%2Fml-1m.zip' diff --git a/python/paddle/text/datasets/uci_housing.py b/python/paddle/text/datasets/uci_housing.py index c876ed409cf992..597b1e1e8185ef 100644 --- a/python/paddle/text/datasets/uci_housing.py +++ b/python/paddle/text/datasets/uci_housing.py @@ -21,6 +21,8 @@ from paddle.io import Dataset from paddle.dataset.common import _check_exists_and_download +__all__ = [] + URL = 'http://paddlemodels.bj.bcebos.com/uci_housing/housing.data' MD5 = 'd4accdce7a25600298819f8e28e8d593' feature_names = [ diff --git a/python/paddle/text/datasets/wmt14.py b/python/paddle/text/datasets/wmt14.py index 96d29c79c6a9d1..424a564216d190 100644 --- a/python/paddle/text/datasets/wmt14.py +++ b/python/paddle/text/datasets/wmt14.py @@ -22,6 +22,8 @@ import paddle.compat as cpt from paddle.dataset.common import _check_exists_and_download +__all__ = [] + URL_DEV_TEST = ('http://www-lium.univ-lemans.fr/~schwenk/' 'cslm_joint_paper/data/dev+test.tgz') MD5_DEV_TEST = '7d7897317ddd8ba0ae5c5fa7248d3ff5' diff --git a/python/paddle/text/datasets/wmt16.py b/python/paddle/text/datasets/wmt16.py index 5605fd2aecbdcc..f95cbe771cadc8 100644 --- a/python/paddle/text/datasets/wmt16.py +++ b/python/paddle/text/datasets/wmt16.py @@ -27,6 +27,8 @@ import paddle.compat as cpt from paddle.dataset.common import _check_exists_and_download +__all__ = [] + DATA_URL = ("http://paddlemodels.bj.bcebos.com/wmt/wmt16.tar.gz") DATA_MD5 = "0c38be43600334966403524a40dcd81e" diff --git a/python/paddle/utils/deprecated.py b/python/paddle/utils/deprecated.py index a46f1ae3a2c2e3..5390dea69fe7d6 100755 --- a/python/paddle/utils/deprecated.py +++ b/python/paddle/utils/deprecated.py @@ -19,6 +19,8 @@ import functools import paddle +__all__ = [] + # NOTE(zhiqiu): Since python 3.2, DeprecationWarning is ignored by default, # and since python 3.7, it is once again shown by default when triggered directly by code in __main__. # See details: https://docs.python.org/3/library/warnings.html#default-warning-filter diff --git a/python/paddle/utils/download.py b/python/paddle/utils/download.py index bd70013e1120e7..ddd1dad9dbdf5a 100644 --- a/python/paddle/utils/download.py +++ b/python/paddle/utils/download.py @@ -55,6 +55,8 @@ def __exit__(self, exc_type, exc_val, exc_tb): import logging logger = logging.getLogger(__name__) +__all__ = [] + WEIGHTS_HOME = osp.expanduser("~/.cache/paddle/hapi/weights") DOWNLOAD_RETRY_LIMIT = 3 diff --git a/python/paddle/utils/image_util.py b/python/paddle/utils/image_util.py index b113f574e9fac0..18be9366c40a7c 100644 --- a/python/paddle/utils/image_util.py +++ b/python/paddle/utils/image_util.py @@ -16,6 +16,8 @@ from PIL import Image from six.moves import cStringIO as StringIO +__all__ = [] + def resize_image(img, target_size): """ diff --git a/python/paddle/utils/install_check.py b/python/paddle/utils/install_check.py index 5d70cf61007a64..69baa4facfa96c 100644 --- a/python/paddle/utils/install_check.py +++ b/python/paddle/utils/install_check.py @@ -20,6 +20,8 @@ import paddle +__all__ = [] + def _simple_network(): """ diff --git a/python/paddle/utils/lazy_import.py b/python/paddle/utils/lazy_import.py index ea07077b2da2a9..d9146422819f8a 100644 --- a/python/paddle/utils/lazy_import.py +++ b/python/paddle/utils/lazy_import.py @@ -15,6 +15,8 @@ import importlib +__all__ = [] + def try_import(module_name): """Try importing a module, with an informative error message on failure.""" diff --git a/python/paddle/utils/op_version.py b/python/paddle/utils/op_version.py index a1fa230d64faac..6e81b5a2c17bb1 100644 --- a/python/paddle/utils/op_version.py +++ b/python/paddle/utils/op_version.py @@ -14,6 +14,8 @@ from ..fluid import core +__all__ = [] + def Singleton(cls): _instance = {}