Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
4bf3c8c5
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4bf3c8c5
编写于
7月 26, 2018
作者:
M
minqiyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use six.moves to migrate zip, map, reduce and pickle in Python2 to Python3
上级
91f0573b
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
20 addition
and
13 deletion
+20
-13
python/paddle/dataset/cifar.py
python/paddle/dataset/cifar.py
+2
-1
python/paddle/dataset/common.py
python/paddle/dataset/common.py
+1
-2
python/paddle/dataset/conll05.py
python/paddle/dataset/conll05.py
+1
-0
python/paddle/dataset/flowers.py
python/paddle/dataset/flowers.py
+2
-1
python/paddle/dataset/image.py
python/paddle/dataset/image.py
+1
-1
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+3
-3
python/paddle/fluid/layer_helper.py
python/paddle/fluid/layer_helper.py
+1
-0
python/paddle/fluid/tests/book/high-level-api/image_classification/cifar10_small_test_set.py
...-level-api/image_classification/cifar10_small_test_set.py
+2
-1
python/paddle/fluid/transpiler/memory_optimization_transpiler.py
...paddle/fluid/transpiler/memory_optimization_transpiler.py
+1
-0
python/paddle/reader/creator.py
python/paddle/reader/creator.py
+1
-1
python/paddle/reader/decorator.py
python/paddle/reader/decorator.py
+2
-0
python/paddle/trainer/PyDataProviderWrapper.py
python/paddle/trainer/PyDataProviderWrapper.py
+1
-1
python/paddle/trainer_config_helpers/data_sources.py
python/paddle/trainer_config_helpers/data_sources.py
+1
-1
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+1
-1
未找到文件。
python/paddle/dataset/cifar.py
浏览文件 @
4bf3c8c5
...
@@ -28,11 +28,12 @@ images per class.
...
@@ -28,11 +28,12 @@ images per class.
"""
"""
import
pickle
import
itertools
import
itertools
import
numpy
import
numpy
import
paddle.dataset.common
import
paddle.dataset.common
import
tarfile
import
tarfile
from
six.moves
import
zip
from
six.moves
import
cPickle
as
pickle
__all__
=
[
'train100'
,
'test100'
,
'train10'
,
'test10'
,
'convert'
]
__all__
=
[
'train100'
,
'test100'
,
'train10'
,
'test10'
,
'convert'
]
...
...
python/paddle/dataset/common.py
浏览文件 @
4bf3c8c5
...
@@ -20,9 +20,8 @@ import shutil
...
@@ -20,9 +20,8 @@ import shutil
import
sys
import
sys
import
importlib
import
importlib
import
paddle.dataset
import
paddle.dataset
import
pickle
import
six.moves.cPickle
as
pickle
import
glob
import
glob
import
pickle
as
pickle
__all__
=
[
__all__
=
[
'DATA_HOME'
,
'DATA_HOME'
,
...
...
python/paddle/dataset/conll05.py
浏览文件 @
4bf3c8c5
...
@@ -24,6 +24,7 @@ import tarfile
...
@@ -24,6 +24,7 @@ import tarfile
import
gzip
import
gzip
import
itertools
import
itertools
import
paddle.dataset.common
import
paddle.dataset.common
from
six.moves
import
zip
__all__
=
[
'test, get_dict'
,
'get_embedding'
,
'convert'
]
__all__
=
[
'test, get_dict'
,
'get_embedding'
,
'convert'
]
...
...
python/paddle/dataset/flowers.py
浏览文件 @
4bf3c8c5
...
@@ -28,7 +28,6 @@ Graphics and Image Processing (2008)
...
@@ -28,7 +28,6 @@ Graphics and Image Processing (2008)
http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}.
http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}.
"""
"""
import
pickle
import
itertools
import
itertools
import
functools
import
functools
from
.common
import
download
from
.common
import
download
...
@@ -39,6 +38,8 @@ from paddle.reader import *
...
@@ -39,6 +38,8 @@ from paddle.reader import *
import
os
import
os
import
numpy
as
np
import
numpy
as
np
from
multiprocessing
import
cpu_count
from
multiprocessing
import
cpu_count
from
six.moves
import
cPickle
as
pickle
from
six.moves
import
zip
__all__
=
[
'train'
,
'test'
,
'valid'
]
__all__
=
[
'train'
,
'test'
,
'valid'
]
DATA_URL
=
'http://www.robots.ox.ac.uk/~vgg/data/flowers/102/102flowers.tgz'
DATA_URL
=
'http://www.robots.ox.ac.uk/~vgg/data/flowers/102/102flowers.tgz'
...
...
python/paddle/dataset/image.py
浏览文件 @
4bf3c8c5
...
@@ -36,7 +36,7 @@ except ImportError:
...
@@ -36,7 +36,7 @@ except ImportError:
cv2
=
None
cv2
=
None
import
os
import
os
import
tarfile
import
tarfile
import
pickle
import
six.moves.cPickle
as
pickle
__all__
=
[
__all__
=
[
"load_image_bytes"
,
"load_image"
,
"resize_short"
,
"to_chw"
,
"center_crop"
,
"load_image_bytes"
,
"load_image"
,
"resize_short"
,
"to_chw"
,
"center_crop"
,
...
...
python/paddle/fluid/framework.py
浏览文件 @
4bf3c8c5
...
@@ -963,9 +963,9 @@ class Block(object):
...
@@ -963,9 +963,9 @@ class Block(object):
raise
ValueError
(
"Var {0} is not found recursively"
.
format
(
name
))
raise
ValueError
(
"Var {0} is not found recursively"
.
format
(
name
))
def
all_parameters
(
self
):
def
all_parameters
(
self
):
return
list
(
self
.
iter_parameters
())
return
list
(
self
.
_
iter_parameters
())
def
iter_parameters
(
self
):
def
_
iter_parameters
(
self
):
return
(
item
[
1
]
for
item
in
list
(
self
.
vars
.
items
())
return
(
item
[
1
]
for
item
in
list
(
self
.
vars
.
items
())
if
isinstance
(
item
[
1
],
Parameter
))
if
isinstance
(
item
[
1
],
Parameter
))
...
@@ -1199,7 +1199,7 @@ class Block(object):
...
@@ -1199,7 +1199,7 @@ class Block(object):
if
not
isinstance
(
other
,
Block
):
if
not
isinstance
(
other
,
Block
):
raise
TypeError
(
raise
TypeError
(
"_copy_param_info_from should be invoked with Block"
)
"_copy_param_info_from should be invoked with Block"
)
for
p
in
other
.
iter_parameters
():
for
p
in
other
.
_
iter_parameters
():
assert
isinstance
(
p
,
Parameter
)
assert
isinstance
(
p
,
Parameter
)
v
=
self
.
vars
.
get
(
p
.
name
,
None
)
v
=
self
.
vars
.
get
(
p
.
name
,
None
)
if
v
is
None
:
if
v
is
None
:
...
...
python/paddle/fluid/layer_helper.py
浏览文件 @
4bf3c8c5
...
@@ -20,6 +20,7 @@ from . import unique_name
...
@@ -20,6 +20,7 @@ from . import unique_name
from
paddle.fluid.initializer
import
Constant
,
Xavier
from
paddle.fluid.initializer
import
Constant
,
Xavier
from
.param_attr
import
ParamAttr
,
WeightNormParamAttr
from
.param_attr
import
ParamAttr
,
WeightNormParamAttr
from
.
import
core
from
.
import
core
from
six.moves
import
zip
class
LayerHelper
(
object
):
class
LayerHelper
(
object
):
...
...
python/paddle/fluid/tests/book/high-level-api/image_classification/cifar10_small_test_set.py
浏览文件 @
4bf3c8c5
...
@@ -28,11 +28,12 @@ images per class.
...
@@ -28,11 +28,12 @@ images per class.
"""
"""
import
pickle
import
itertools
import
itertools
import
numpy
import
numpy
import
paddle.v2.dataset.common
import
paddle.v2.dataset.common
import
tarfile
import
tarfile
from
six.moves
import
cPickle
as
pickle
from
six.moves
import
zip
__all__
=
[
'train10'
]
__all__
=
[
'train10'
]
...
...
python/paddle/fluid/transpiler/memory_optimization_transpiler.py
浏览文件 @
4bf3c8c5
...
@@ -17,6 +17,7 @@ from .. import core
...
@@ -17,6 +17,7 @@ from .. import core
from
..framework
import
Program
,
default_main_program
,
Parameter
from
..framework
import
Program
,
default_main_program
,
Parameter
from
..backward
import
_rename_arg_
from
..backward
import
_rename_arg_
from
functools
import
reduce
from
functools
import
reduce
from
six.moves
import
range
dtype_to_size
=
{
dtype_to_size
=
{
core
.
VarDesc
.
VarType
.
FP16
:
2
,
core
.
VarDesc
.
VarType
.
FP16
:
2
,
...
...
python/paddle/reader/creator.py
浏览文件 @
4bf3c8c5
...
@@ -67,7 +67,7 @@ def recordio(paths, buf_size=100):
...
@@ -67,7 +67,7 @@ def recordio(paths, buf_size=100):
import
recordio
as
rec
import
recordio
as
rec
import
paddle.reader.decorator
as
dec
import
paddle.reader.decorator
as
dec
import
p
ickle
as
pickle
import
six.moves.cP
ickle
as
pickle
def
reader
():
def
reader
():
if
isinstance
(
paths
,
str
):
if
isinstance
(
paths
,
str
):
...
...
python/paddle/reader/decorator.py
浏览文件 @
4bf3c8c5
...
@@ -22,6 +22,8 @@ import subprocess
...
@@ -22,6 +22,8 @@ import subprocess
from
six.moves.queue
import
Queue
from
six.moves.queue
import
Queue
from
six.moves
import
zip_longest
from
six.moves
import
zip_longest
from
six.moves
import
map
from
six.moves
import
zip
import
itertools
import
itertools
import
random
import
random
import
zlib
import
zlib
...
...
python/paddle/trainer/PyDataProviderWrapper.py
浏览文件 @
4bf3c8c5
...
@@ -42,7 +42,7 @@ except ImportError:
...
@@ -42,7 +42,7 @@ except ImportError:
try
:
try
:
import
cPickle
as
pickle
import
cPickle
as
pickle
except
ImportError
:
except
ImportError
:
import
pickle
import
six.moves.cPickle
as
pickle
import
io
import
io
...
...
python/paddle/trainer_config_helpers/data_sources.py
浏览文件 @
4bf3c8c5
...
@@ -20,7 +20,7 @@ from .utils import deprecated
...
@@ -20,7 +20,7 @@ from .utils import deprecated
try
:
try
:
import
cPickle
as
pickle
import
cPickle
as
pickle
except
ImportError
:
except
ImportError
:
import
pickle
import
six.moves.cPickle
as
pickle
__all__
=
[
'define_py_data_sources2'
]
__all__
=
[
'define_py_data_sources2'
]
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
4bf3c8c5
...
@@ -28,7 +28,7 @@ from .default_decorators import *
...
@@ -28,7 +28,7 @@ from .default_decorators import *
try
:
try
:
import
cPickle
as
pickle
import
cPickle
as
pickle
except
ImportError
:
except
ImportError
:
import
pickle
import
six.moves.cPickle
as
pickle
import
copy
import
copy
__all__
=
[
__all__
=
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录