Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
afeixing77
Paddle
提交
9930a582
P
Paddle
项目概览
afeixing77
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9930a582
编写于
4月 27, 2021
作者:
Z
zhiboniu
提交者:
GitHub
4月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update 2.0 public api in dataset&framework (#31985)
上级
f1bc322c
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
38 addition
and
98 deletion
+38
-98
python/paddle/__init__.py
python/paddle/__init__.py
+1
-0
python/paddle/dataset/__init__.py
python/paddle/dataset/__init__.py
+12
-12
python/paddle/dataset/cifar.py
python/paddle/dataset/cifar.py
+0
-2
python/paddle/dataset/common.py
python/paddle/dataset/common.py
+0
-8
python/paddle/dataset/conll05.py
python/paddle/dataset/conll05.py
+0
-2
python/paddle/dataset/flowers.py
python/paddle/dataset/flowers.py
+6
-2
python/paddle/dataset/image.py
python/paddle/dataset/image.py
+0
-6
python/paddle/dataset/imdb.py
python/paddle/dataset/imdb.py
+0
-2
python/paddle/dataset/imikolov.py
python/paddle/dataset/imikolov.py
+0
-2
python/paddle/dataset/mnist.py
python/paddle/dataset/mnist.py
+0
-1
python/paddle/dataset/movielens.py
python/paddle/dataset/movielens.py
+0
-5
python/paddle/dataset/uci_housing.py
python/paddle/dataset/uci_housing.py
+0
-2
python/paddle/dataset/voc2012.py
python/paddle/dataset/voc2012.py
+0
-2
python/paddle/dataset/wmt14.py
python/paddle/dataset/wmt14.py
+0
-6
python/paddle/dataset/wmt16.py
python/paddle/dataset/wmt16.py
+0
-8
python/paddle/framework/__init__.py
python/paddle/framework/__init__.py
+19
-29
python/paddle/framework/framework.py
python/paddle/framework/framework.py
+0
-2
python/paddle/framework/io.py
python/paddle/framework/io.py
+0
-5
python/paddle/framework/random.py
python/paddle/framework/random.py
+0
-2
未找到文件。
python/paddle/__init__.py
浏览文件 @
9930a582
...
...
@@ -265,6 +265,7 @@ from .framework import DataParallel #DEFINE_ALIAS
from
.framework
import
set_default_dtype
#DEFINE_ALIAS
from
.framework
import
get_default_dtype
#DEFINE_ALIAS
from
.framework
import
set_grad_enabled
#DEFINE_ALIAS
from
.tensor.search
import
index_sample
#DEFINE_ALIAS
from
.tensor.stat
import
mean
#DEFINE_ALIAS
...
...
python/paddle/dataset/__init__.py
浏览文件 @
9930a582
...
...
@@ -15,18 +15,18 @@
Dataset package.
"""
import
paddle.dataset.mnist
import
paddle.dataset.imikolov
import
paddle.dataset.imdb
import
paddle.dataset.cifar
import
paddle.dataset.movielens
import
paddle.dataset.conll05
import
paddle.dataset.uci_housing
import
paddle.dataset.wmt14
import
paddle.dataset.wmt16
import
paddle.dataset.flowers
import
paddle.dataset.voc2012
import
paddle.dataset.image
import
paddle.dataset.mnist
# noqa: F401
import
paddle.dataset.imikolov
# noqa: F401
import
paddle.dataset.imdb
# noqa: F401
import
paddle.dataset.cifar
# noqa: F401
import
paddle.dataset.movielens
# noqa: F401
import
paddle.dataset.conll05
# noqa: F401
import
paddle.dataset.uci_housing
# noqa: F401
import
paddle.dataset.wmt14
# noqa: F401
import
paddle.dataset.wmt16
# noqa: F401
import
paddle.dataset.flowers
# noqa: F401
import
paddle.dataset.voc2012
# noqa: F401
import
paddle.dataset.image
# noqa: F401
# set __all__ as empty for not showing APIs under paddle.dataset
__all__
=
[]
python/paddle/dataset/cifar.py
浏览文件 @
9930a582
...
...
@@ -37,8 +37,6 @@ import tarfile
import
six
from
six.moves
import
cPickle
as
pickle
__all__
=
[
'train100'
,
'test100'
,
'train10'
,
'test10'
]
URL_PREFIX
=
'https://dataset.bj.bcebos.com/cifar/'
CIFAR10_URL
=
URL_PREFIX
+
'cifar-10-python.tar.gz'
CIFAR10_MD5
=
'c58f30108f718f92721af3b95e74349a'
...
...
python/paddle/dataset/common.py
浏览文件 @
9930a582
...
...
@@ -26,14 +26,6 @@ import paddle.dataset
import
six.moves.cPickle
as
pickle
import
glob
__all__
=
[
'DATA_HOME'
,
'download'
,
'md5file'
,
'split'
,
'cluster_files_reader'
,
]
HOME
=
os
.
path
.
expanduser
(
'~'
)
DATA_HOME
=
os
.
path
.
join
(
HOME
,
'.cache'
,
'paddle'
,
'dataset'
)
...
...
python/paddle/dataset/conll05.py
浏览文件 @
9930a582
...
...
@@ -30,8 +30,6 @@ import paddle.compat as cpt
import
paddle.utils.deprecated
as
deprecated
from
six.moves
import
zip
,
range
__all__
=
[
'test, get_dict'
,
'get_embedding'
]
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'
...
...
python/paddle/dataset/flowers.py
浏览文件 @
9930a582
...
...
@@ -35,7 +35,12 @@ import itertools
import
functools
from
.common
import
download
import
tarfile
from
paddle.dataset.image
import
*
from
paddle.dataset.image
import
load_image_bytes
from
paddle.dataset.image
import
load_image
from
paddle.dataset.image
import
simple_transform
from
paddle.dataset.image
import
batch_images_from_tar
from
paddle.reader
import
map_readers
,
xmap_readers
from
paddle
import
compat
as
cpt
import
paddle.utils.deprecated
as
deprecated
...
...
@@ -45,7 +50,6 @@ from multiprocessing import cpu_count
import
six
from
six.moves
import
cPickle
as
pickle
from
paddle.utils
import
try_import
__all__
=
[
'train'
,
'test'
,
'valid'
]
DATA_URL
=
'http://paddlemodels.bj.bcebos.com/flowers/102flowers.tgz'
LABEL_URL
=
'http://paddlemodels.bj.bcebos.com/flowers/imagelabels.mat'
...
...
python/paddle/dataset/image.py
浏览文件 @
9930a582
...
...
@@ -58,12 +58,6 @@ import os
import
tarfile
import
six.moves.cPickle
as
pickle
__all__
=
[
"load_image_bytes"
,
"load_image"
,
"resize_short"
,
"to_chw"
,
"center_crop"
,
"random_crop"
,
"left_right_flip"
,
"simple_transform"
,
"load_and_transform"
,
"batch_images_from_tar"
]
def
_check_cv2
():
if
cv2
is
None
:
...
...
python/paddle/dataset/imdb.py
浏览文件 @
9930a582
...
...
@@ -30,8 +30,6 @@ import re
import
string
import
six
__all__
=
[
'build_dict'
,
'train'
,
'test'
]
#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'
...
...
python/paddle/dataset/imikolov.py
浏览文件 @
9930a582
...
...
@@ -27,8 +27,6 @@ import collections
import
tarfile
import
six
__all__
=
[
'train'
,
'test'
,
'build_dict'
]
#URL = 'http://www.fit.vutbr.cz/~imikolov/rnnlm/simple-examples.tgz'
URL
=
'https://dataset.bj.bcebos.com/imikolov%2Fsimple-examples.tgz'
MD5
=
'30177ea32e27c525793142b6bf2c8e2d'
...
...
python/paddle/dataset/mnist.py
浏览文件 @
9930a582
...
...
@@ -26,7 +26,6 @@ import gzip
import
numpy
import
struct
from
six.moves
import
range
__all__
=
[
'train'
,
'test'
]
URL_PREFIX
=
'https://dataset.bj.bcebos.com/mnist/'
TEST_IMAGE_URL
=
URL_PREFIX
+
't10k-images-idx3-ubyte.gz'
...
...
python/paddle/dataset/movielens.py
浏览文件 @
9930a582
...
...
@@ -34,11 +34,6 @@ import functools
import
six
import
paddle.compat
as
cpt
__all__
=
[
'train'
,
'test'
,
'get_movie_title_dict'
,
'max_movie_id'
,
'max_user_id'
,
'age_table'
,
'movie_categories'
,
'max_job_id'
,
'user_info'
,
'movie_info'
]
age_table
=
[
1
,
18
,
25
,
35
,
45
,
50
,
56
]
#URL = 'http://files.grouplens.org/datasets/movielens/ml-1m.zip'
...
...
python/paddle/dataset/uci_housing.py
浏览文件 @
9930a582
...
...
@@ -29,8 +29,6 @@ import os
import
paddle.dataset.common
import
paddle.utils.deprecated
as
deprecated
__all__
=
[
'train'
,
'test'
]
URL
=
'http://paddlemodels.bj.bcebos.com/uci_housing/housing.data'
MD5
=
'd4accdce7a25600298819f8e28e8d593'
feature_names
=
[
...
...
python/paddle/dataset/voc2012.py
浏览文件 @
9930a582
...
...
@@ -29,8 +29,6 @@ from paddle.dataset.image import *
import
paddle.utils.deprecated
as
deprecated
from
PIL
import
Image
__all__
=
[
'train'
,
'test'
,
'val'
]
VOC_URL
=
'http://host.robots.ox.ac.uk/pascal/VOC/voc2012/
\
VOCtrainval_11-May-2012.tar'
...
...
python/paddle/dataset/wmt14.py
浏览文件 @
9930a582
...
...
@@ -30,12 +30,6 @@ import paddle.dataset.common
import
paddle.compat
as
cpt
import
paddle.utils.deprecated
as
deprecated
__all__
=
[
'train'
,
'test'
,
'get_dict'
,
]
URL_DEV_TEST
=
(
'http://www-lium.univ-lemans.fr/~schwenk/'
'cslm_joint_paper/data/dev+test.tgz'
)
MD5_DEV_TEST
=
'7d7897317ddd8ba0ae5c5fa7248d3ff5'
...
...
python/paddle/dataset/wmt16.py
浏览文件 @
9930a582
...
...
@@ -40,14 +40,6 @@ import paddle
import
paddle.compat
as
cpt
import
paddle.utils.deprecated
as
deprecated
__all__
=
[
"train"
,
"test"
,
"validation"
,
"fetch"
,
"get_dict"
,
]
DATA_URL
=
(
"http://paddlemodels.bj.bcebos.com/wmt/wmt16.tar.gz"
)
DATA_MD5
=
"0c38be43600334966403524a40dcd81e"
...
...
python/paddle/framework/__init__.py
浏览文件 @
9930a582
...
...
@@ -12,35 +12,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: import framework api under this directory
__all__
=
[
'create_parameter'
,
'ParamAttr'
,
'CPUPlace'
,
'CUDAPlace'
,
'CUDAPinnedPlace'
,
'NPUPlace'
,
'get_default_dtype'
,
'set_default_dtype'
]
# TODO: import framework api under this directory
__all__
+=
[
'grad'
,
'set_grad_enabled'
,
'LayerList'
,
'load'
,
'save'
,
'no_grad'
,
'DataParallel'
]
from
.
import
random
# noqa: F401
from
.random
import
seed
# noqa: F401
from
.framework
import
get_default_dtype
# noqa: F401
from
.framework
import
set_default_dtype
# noqa: F401
from
.framework
import
set_grad_enabled
# noqa: F401
from
.
import
random
from
.random
import
seed
from
.framework
import
get_default_dtype
from
.framework
import
set_default_dtype
from
.framework
import
set_grad_enabled
from
..fluid.param_attr
import
ParamAttr
# noqa: F401
from
..fluid.layers.tensor
import
create_parameter
# noqa: F401
from
..fluid.core
import
CPUPlace
# noqa: F401
from
..fluid.core
import
CUDAPlace
# noqa: F401
from
..fluid.core
import
CUDAPinnedPlace
# noqa: F401
from
..fluid.core
import
NPUPlace
# noqa: F401
from
..fluid.core
import
VarBase
# noqa: F401
from
..fluid.param_attr
import
ParamAttr
#DEFINE_ALIAS
# from ..fluid.layers.tensor import create_global_var #DEFINE_ALIAS
from
..fluid.layers.tensor
import
create_parameter
#DEFINE_ALIAS
from
..fluid.core
import
CPUPlace
#DEFINE_ALIAS
from
..fluid.core
import
CUDAPlace
#DEFINE_ALIAS
from
..fluid.core
import
CUDAPinnedPlace
#DEFINE_ALIAS
from
..fluid.core
import
NPUPlace
#DEFINE_ALIAS
from
..fluid.core
import
VarBase
#DEFINE_ALIAS
from
paddle.fluid
import
core
#DEFINE_ALIAS
from
..fluid.dygraph.base
import
no_grad_
as
no_grad
#DEFINE_ALIAS
from
..fluid.dygraph.base
import
grad
#DEFINE_ALIAS
from
.io
import
save
from
.io
import
load
from
..fluid.dygraph.parallel
import
DataParallel
#DEFINE_ALIAS
from
paddle.fluid
import
core
# noqa: F401
from
..fluid.dygraph.base
import
no_grad_
as
no_grad
# noqa: F401
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
python/paddle/framework/framework.py
浏览文件 @
9930a582
...
...
@@ -19,8 +19,6 @@ from paddle.fluid.framework import _dygraph_tracer
import
numpy
as
np
from
contextlib
import
contextmanager
__all__
=
[
'set_default_dtype'
,
'get_default_dtype'
]
def
set_default_dtype
(
d
):
"""
...
...
python/paddle/framework/io.py
浏览文件 @
9930a582
...
...
@@ -38,11 +38,6 @@ 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__
=
[
'save'
,
'load'
,
]
def
_build_saved_state_dict
(
state_dict
):
save_dict
=
{}
...
...
python/paddle/framework/random.py
浏览文件 @
9930a582
...
...
@@ -16,8 +16,6 @@
import
paddle.fluid
as
fluid
from
paddle.fluid
import
core
__all__
=
[
'seed'
,
'get_cuda_rng_state'
,
'set_cuda_rng_state'
]
def
seed
(
seed
):
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录