未验证 提交 69d237c2 编写于 作者: Z zhiboniu 提交者: GitHub

add __all__=[] to python files not in API public list; import * only support...

add __all__=[] to python files not in API public list; import * only support in API public list files (#32643)
上级 b22f6d69
......@@ -37,6 +37,8 @@ import tarfile
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'
......
......@@ -26,6 +26,8 @@ import paddle.dataset
import six.moves.cPickle as pickle
import glob
__all__ = []
HOME = os.path.expanduser('~')
DATA_HOME = os.path.join(HOME, '.cache', 'paddle', 'dataset')
......
......@@ -30,6 +30,8 @@ import paddle.compat as cpt
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'
......
......@@ -51,6 +51,8 @@ import six
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'
......
......@@ -58,6 +58,8 @@ import os
import tarfile
import six.moves.cPickle as pickle
__all__ = []
def _check_cv2():
if cv2 is None:
......
......@@ -30,6 +30,8 @@ import re
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'
......
......@@ -27,6 +27,8 @@ import collections
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'
......
......@@ -27,6 +27,8 @@ import numpy
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'
......
......@@ -34,6 +34,8 @@ import functools
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'
......
......@@ -17,6 +17,8 @@ from __future__ import print_function
import paddle.dataset.cifar
import unittest
__all__ = []
class TestCIFAR(unittest.TestCase):
def check_reader(self, reader):
......
......@@ -17,6 +17,8 @@ from __future__ import print_function
import paddle.dataset.flowers
import unittest
__all__ = []
class TestFlowers(unittest.TestCase):
def check_reader(self, reader):
......
......@@ -18,6 +18,8 @@ import paddle.dataset.imdb
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$")
......
......@@ -19,6 +19,8 @@ import unittest
WORD_DICT = paddle.dataset.imikolov.build_dict()
__all__ = []
class TestMikolov(unittest.TestCase):
def check_reader(self, reader, n):
......
......@@ -17,6 +17,8 @@ from __future__ import print_function
import paddle.dataset.mnist
import unittest
__all__ = []
class TestMNIST(unittest.TestCase):
def check_reader(self, reader):
......
......@@ -19,6 +19,8 @@ import numpy as np
import paddle.dataset.image as image
__all__ = []
class Image(unittest.TestCase):
def test_resize_flip_chw(self):
......
......@@ -17,6 +17,8 @@ from __future__ import print_function
import paddle.dataset.voc2012
import unittest
__all__ = []
class TestVOC(unittest.TestCase):
def check_reader(self, reader):
......
......@@ -17,6 +17,8 @@ from __future__ import print_function
import paddle.dataset.wmt16
import unittest
__all__ = []
class TestWMT16(unittest.TestCase):
def checkout_one_sample(self, sample):
......
......@@ -29,6 +29,8 @@ import os
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 = [
......
......@@ -25,10 +25,11 @@ import tarfile
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'
......
......@@ -30,6 +30,8 @@ import paddle.dataset.common
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'
......
......@@ -40,6 +40,8 @@ import paddle
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"
......
......@@ -34,3 +34,5 @@ from ..fluid.dygraph.base import grad # noqa: F401
from .io import save # noqa: F401
from .io import load # noqa: F401
from ..fluid.dygraph.parallel import DataParallel # noqa: F401
__all__ = []
......@@ -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 @@ complex64 = VarDesc.VarType.COMPLEX64
complex128 = VarDesc.VarType.COMPLEX128
bool = VarDesc.VarType.BOOL
__all__ = []
......@@ -19,6 +19,8 @@ from paddle.fluid.framework import _dygraph_tracer
import numpy as np
from contextlib import contextmanager
__all__ = []
def set_default_dtype(d):
"""
......
......@@ -38,6 +38,8 @@ from paddle.fluid.dygraph.jit import _SaveLoadConfig
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 = {}
......
......@@ -16,6 +16,8 @@
import paddle.fluid as fluid
from paddle.fluid import core
__all__ = []
def seed(seed):
"""
......
......@@ -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__ = []
......@@ -14,3 +14,5 @@
from ..fluid.layers import BeamSearchDecoder # noqa: F401
from ..fluid.layers import dynamic_decode # noqa: F401
__all__ = []
......@@ -27,6 +27,8 @@ from ...fluid import core
from ...fluid.data_feeder import check_variable_and_dtype, check_dtype
import paddle
__all__ = []
def elu(x, alpha=1.0, name=None):
r"""
......
......@@ -34,6 +34,8 @@ from ...fluid import core, dygraph_utils
from ...fluid import core, layers
from ...fluid.data_feeder import check_variable_and_dtype
__all__ = []
def interpolate(x,
size=None,
......
......@@ -22,6 +22,8 @@ from ...fluid.data_feeder import check_variable_and_dtype
from ...fluid.param_attr import ParamAttr
from ...fluid.layer_helper import LayerHelper
__all__ = []
def _is_list_or_tuple(input):
return isinstance(input, (list, tuple))
......
......@@ -23,6 +23,8 @@ from ...fluid import core, dygraph_utils
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):
"""
......
......@@ -19,6 +19,8 @@ from ...fluid.layer_helper import LayerHelper
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):
"""
......
......@@ -39,6 +39,8 @@ from ...fluid.framework import _varbase_creator
from ...fluid.framework import Variable
from paddle.utils import deprecated
__all__ = []
def binary_cross_entropy(input, label, weight=None, reduction='mean',
name=None):
......
......@@ -24,6 +24,8 @@ from ...fluid.param_attr import ParamAttr
from ...fluid import core, dygraph_utils
import numbers
__all__ = []
def normalize(x, p=2, axis=1, epsilon=1e-12, name=None):
r"""
......
......@@ -18,6 +18,8 @@ from ...fluid.framework import in_dygraph_mode
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))
......
......@@ -19,6 +19,8 @@ from ...fluid.data_feeder import check_variable_and_dtype
from ...fluid import dygraph_utils
import numpy as np
__all__ = []
def affine_grid(theta, out_shape, align_corners=True, name=None):
"""
......
......@@ -19,6 +19,8 @@ from ...fluid.core import VarDesc
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.
......
......@@ -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.
......
......@@ -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
......
......@@ -15,6 +15,8 @@
from ...fluid.initializer import NormalInitializer
from ...fluid.initializer import TruncatedNormalInitializer
__all__ = []
class Normal(NormalInitializer):
"""The Random Normal (Gaussian) distribution initializer.
......
......@@ -14,6 +14,8 @@
from ...fluid.initializer import UniformInitializer
__all__ = []
class Uniform(UniformInitializer):
"""The random uniform distribution initializer.
......
......@@ -14,6 +14,8 @@
from ...fluid.initializer import XavierInitializer
__all__ = []
class XavierNormal(XavierInitializer):
r"""
......
......@@ -81,3 +81,5 @@ from .norm import LocalResponseNorm # noqa: F401
from .vision import PixelShuffle # noqa: F401
from .distance import PairwiseDistance # noqa: F401
from .container import LayerDict # noqa: F401
__all__ = []
......@@ -22,6 +22,8 @@ from ...fluid.initializer import Constant
from paddle.framework import get_default_dtype
from .. import functional as F
__all__ = []
class ELU(layers.Layer):
r"""
......
......@@ -20,6 +20,8 @@ from ...fluid.framework import in_dygraph_mode
from .. import functional as F
from ...fluid.framework import _dygraph_tracer
__all__ = []
def _npairs(x, n):
if isinstance(x, (paddle.Tensor, list)):
......
......@@ -16,7 +16,7 @@ from collections import OrderedDict
from ...fluid.dygraph.layers import Layer
from six.moves import collections_abc
__all__ = ['LayerDict', ]
__all__ = []
class LayerDict(Layer):
......
......@@ -25,6 +25,8 @@ from .. import functional as F
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)
......
......@@ -20,6 +20,8 @@ from ...fluid.framework import core, in_dygraph_mode
from ...fluid.data_feeder import check_variable_and_dtype, check_type
from ...fluid.layer_helper import LayerHelper
__all__ = []
class PairwiseDistance(layers.Layer):
r"""
......
......@@ -21,6 +21,8 @@ import paddle
from .. import functional as F
from paddle.fluid.framework import core, in_dygraph_mode, _varbase_creator
__all__ = []
class BCEWithLogitsLoss(fluid.dygraph.Layer):
r"""
......
......@@ -50,6 +50,8 @@ import warnings
from ...fluid.dygraph.base import no_grad
from .. import functional as F
__all__ = []
class _InstanceNormBase(layers.Layer):
"""
......
......@@ -16,6 +16,8 @@ from ...fluid.dygraph import layers
from ...fluid.layer_helper import LayerHelper
from .. import functional as F
__all__ = []
class AvgPool1D(layers.Layer):
r"""
......
......@@ -33,6 +33,8 @@ from paddle.fluid.layers import utils
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"""
......
......@@ -28,6 +28,8 @@ from ...fluid.dygraph import Layer, LayerList
from ...fluid.param_attr import ParamAttr
from ...fluid.data_feeder import convert_dtype
__all__ = []
def _convert_param_attr_to_list(param_attr, n):
"""
......
......@@ -17,6 +17,8 @@
from ...fluid.dygraph import layers
from .. import functional
__all__ = []
class PixelShuffle(layers.Layer):
"""
......
......@@ -19,6 +19,8 @@ from ...fluid import layers as F
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:
......
......@@ -17,6 +17,8 @@ from ..fluid import core
from ..fluid import framework
from ..fluid.framework import Variable, name_scope
__all__ = []
class Adadelta(Optimizer):
r"""
......
......@@ -17,6 +17,8 @@ from ..fluid import core
from ..fluid import framework
from ..fluid.framework import Variable
__all__ = []
class Adagrad(Optimizer):
r"""
......
......@@ -24,6 +24,8 @@ from ..fluid.dygraph import base as imperative_base
import paddle
__all__ = []
class Adam(Optimizer):
r"""
......
......@@ -17,6 +17,8 @@ from ..fluid import core
from ..fluid import framework
from ..fluid.framework import Variable, name_scope
__all__ = []
class Adamax(Optimizer):
r"""
......
......@@ -19,6 +19,8 @@ from ..fluid import framework
from ..fluid.dygraph import base as imperative_base
import paddle
__all__ = []
class AdamW(Adam):
r"""
......
......@@ -17,6 +17,8 @@ from ..fluid import core
from ..fluid import framework
from ..fluid.framework import Variable
__all__ = []
class Lamb(Optimizer):
r"""
......
......@@ -22,6 +22,8 @@ from ..fluid import layers
import paddle.fluid as fluid
from paddle.fluid.regularizer import L2DecayRegularizer
__all__ = []
class Momentum(Optimizer):
r"""
......
......@@ -42,6 +42,8 @@ from ..fluid.wrapped_decorator import signature_safe_contextmanager
from .. import compat as cpt
from .lr import LRScheduler
__all__ = []
class Optimizer(object):
r"""Optimizer Base class.
......
......@@ -17,6 +17,8 @@ from ..fluid import core
from ..fluid import framework
from ..fluid.framework import Variable
__all__ = []
class RMSProp(Optimizer):
r"""
......
......@@ -18,6 +18,8 @@ from ..fluid import framework
from ..fluid.framework import Variable, name_scope
from ..fluid.dygraph import no_grad
__all__ = []
class SGD(Optimizer):
r"""
......
......@@ -14,3 +14,5 @@
from paddle.proto.TrainerConfig_pb2 import OptimizationConfig, TrainerConfig
from paddle.proto.ModelConfig_pb2 import ModelConfig
__all__ = []
......@@ -27,6 +27,8 @@ import random
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.
......
......@@ -19,6 +19,8 @@ import functools
import paddle.reader
__all__ = []
def reader_creator_10(dur):
def reader():
......
......@@ -21,6 +21,8 @@ from paddle.fluid.data_feeder import check_type
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):
......
......@@ -37,6 +37,8 @@ from paddle.fluid.framework import static_only, Parameter
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')
......
......@@ -15,6 +15,8 @@
import paddle
from paddle.fluid.framework import static_only
__all__ = []
@static_only
def fc(x,
......
......@@ -16,6 +16,8 @@
from ..fluid import layers
__all__ = []
def array_length(array):
"""
......
......@@ -22,6 +22,8 @@ from ..fluid.data_feeder import check_variable_and_dtype
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:
......
......@@ -31,6 +31,8 @@ from ..fluid.framework import convert_np_dtype_to_dtype_, in_dygraph_mode, _varb
from ..fluid.layers import linspace # noqa: F401
import paddle
__all__ = []
@dygraph_only
def to_tensor(data, dtype=None, place=None, stop_gradient=True):
......
......@@ -21,6 +21,8 @@ from ..fluid.layers import transpose # noqa: F401
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):
"""
......
......@@ -28,6 +28,8 @@ from ..fluid.layers import logical_xor # noqa: F401
from paddle.common_ops_import import core
__all__ = []
def equal_all(x, y, name=None):
"""
......
......@@ -34,6 +34,8 @@ from ..fluid import layers
import paddle
import warnings
__all__ = []
def _print_warning_in_static_mode(api_name):
warnings.warn(
......
......@@ -59,6 +59,8 @@ from ..fluid.layers import sin # noqa: F401
from ..fluid.layers import multiplex # noqa: F401
from ..fluid import layers
__all__ = []
_supported_int_dtype_ = [
VarDesc.VarType.UINT8,
VarDesc.VarType.INT8,
......
......@@ -21,6 +21,8 @@ from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtyp
from ..fluid.layers import utils
import paddle
__all__ = []
def bernoulli(x, name=None):
"""
......
......@@ -25,6 +25,8 @@ from paddle.common_ops_import import VarDesc
# 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):
"""
......
......@@ -23,6 +23,8 @@ from .search import where
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):
"""
......
......@@ -17,6 +17,8 @@ import numpy as np
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
......
......@@ -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):
......
......@@ -16,7 +16,7 @@ import os
import unittest
import numpy as np
from paddle.text.datasets import *
from paddle.text.datasets import Conll05st
class TestConll05st(unittest.TestCase):
......
......@@ -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):
......
......@@ -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):
......
......@@ -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):
......
......@@ -19,7 +19,7 @@ import tempfile
import shutil
import cv2
from paddle.text.datasets import *
from paddle.text.datasets import UCIHousing, WMT14
class TestUCIHousingTrain(unittest.TestCase):
......
......@@ -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):
......
......@@ -20,7 +20,7 @@ import shutil
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
......
......@@ -19,3 +19,5 @@ from .movielens import Movielens # noqa: F401
from .uci_housing import UCIHousing # noqa: F401
from .wmt14 import WMT14 # noqa: F401
from .wmt16 import WMT16 # noqa: F401
__all__ = []
......@@ -24,6 +24,8 @@ from paddle.io import Dataset
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'
......
......@@ -24,6 +24,8 @@ import collections
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'
......
......@@ -22,6 +22,8 @@ import collections
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'
......
......@@ -26,6 +26,8 @@ from paddle.io import Dataset
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'
......
......@@ -21,6 +21,8 @@ import paddle
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 = [
......
......@@ -22,6 +22,8 @@ from paddle.io import Dataset
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'
......
......@@ -27,6 +27,8 @@ from paddle.io import Dataset
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"
......
......@@ -19,6 +19,8 @@ import warnings
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
......
......@@ -55,6 +55,8 @@ except:
import logging
logger = logging.getLogger(__name__)
__all__ = []
WEIGHTS_HOME = osp.expanduser("~/.cache/paddle/hapi/weights")
DOWNLOAD_RETRY_LIMIT = 3
......
......@@ -16,6 +16,8 @@ import numpy as np
from PIL import Image
from six.moves import cStringIO as StringIO
__all__ = []
def resize_image(img, target_size):
"""
......
......@@ -20,6 +20,8 @@ import numpy as np
import paddle
__all__ = []
def _simple_network():
"""
......
......@@ -15,6 +15,8 @@
import importlib
__all__ = []
def try_import(module_name):
"""Try importing a module, with an informative error message on failure."""
......
......@@ -14,6 +14,8 @@
from ..fluid import core
__all__ = []
def Singleton(cls):
_instance = {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册