Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
c5292b18
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c5292b18
编写于
9月 28, 2018
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change py_reader_by_data to create_py_reader_by_data
上级
9d3fa1be
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
8 deletion
+11
-8
paddle/fluid/API.spec
paddle/fluid/API.spec
+1
-1
python/paddle/fluid/layers/io.py
python/paddle/fluid/layers/io.py
+7
-5
python/paddle/fluid/tests/unittests/test_py_reader_using_executor.py
...le/fluid/tests/unittests/test_py_reader_using_executor.py
+3
-2
未找到文件。
paddle/fluid/API.spec
浏览文件 @
c5292b18
...
@@ -168,7 +168,7 @@ paddle.fluid.layers.batch ArgSpec(args=['reader', 'batch_size'], varargs=None, k
...
@@ -168,7 +168,7 @@ paddle.fluid.layers.batch ArgSpec(args=['reader', 'batch_size'], varargs=None, k
paddle.fluid.layers.double_buffer ArgSpec(args=['reader', 'place', 'name'], varargs=None, keywords=None, defaults=(None, None))
paddle.fluid.layers.double_buffer ArgSpec(args=['reader', 'place', 'name'], varargs=None, keywords=None, defaults=(None, None))
paddle.fluid.layers.random_data_generator ArgSpec(args=['low', 'high', 'shapes', 'lod_levels', 'for_parallel'], varargs=None, keywords=None, defaults=(True,))
paddle.fluid.layers.random_data_generator ArgSpec(args=['low', 'high', 'shapes', 'lod_levels', 'for_parallel'], varargs=None, keywords=None, defaults=(True,))
paddle.fluid.layers.py_reader ArgSpec(args=['capacity', 'shapes', 'dtypes', 'lod_levels', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, None, True))
paddle.fluid.layers.py_reader ArgSpec(args=['capacity', 'shapes', 'dtypes', 'lod_levels', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, None, True))
paddle.fluid.layers.py_reader_by_data ArgSpec(args=['capacity', 'feed_list', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, True))
paddle.fluid.layers.
create_
py_reader_by_data ArgSpec(args=['capacity', 'feed_list', 'name', 'use_double_buffer'], varargs=None, keywords=None, defaults=(None, True))
paddle.fluid.layers.Preprocessor.__init__ ArgSpec(args=['self', 'reader', 'name'], varargs=None, keywords=None, defaults=(None,))
paddle.fluid.layers.Preprocessor.__init__ ArgSpec(args=['self', 'reader', 'name'], varargs=None, keywords=None, defaults=(None,))
paddle.fluid.layers.Preprocessor.block ArgSpec(args=[], varargs='args', keywords='kwds', defaults=None)
paddle.fluid.layers.Preprocessor.block ArgSpec(args=[], varargs='args', keywords='kwds', defaults=None)
paddle.fluid.layers.Preprocessor.inputs ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None)
paddle.fluid.layers.Preprocessor.inputs ArgSpec(args=['self'], varargs=None, keywords=None, defaults=None)
...
...
python/paddle/fluid/layers/io.py
浏览文件 @
c5292b18
...
@@ -30,8 +30,8 @@ from ..unique_name import generate as unique_name
...
@@ -30,8 +30,8 @@ from ..unique_name import generate as unique_name
__all__
=
[
__all__
=
[
'data'
,
'open_files'
,
'read_file'
,
'shuffle'
,
'batch'
,
'double_buffer'
,
'data'
,
'open_files'
,
'read_file'
,
'shuffle'
,
'batch'
,
'double_buffer'
,
'random_data_generator'
,
'py_reader'
,
'
py_reader_by_data'
,
'Preprocessor
'
,
'random_data_generator'
,
'py_reader'
,
'
create_py_reader_by_data
'
,
'load'
'
Preprocessor'
,
'
load'
]
]
...
@@ -480,7 +480,7 @@ def _py_reader(capacity,
...
@@ -480,7 +480,7 @@ def _py_reader(capacity,
feed_list
=
None
):
feed_list
=
None
):
if
feed_list
is
not
None
:
if
feed_list
is
not
None
:
if
isinstance
(
feed_list
,
list
):
if
not
isinstance
(
feed_list
,
list
):
raise
TypeError
(
"feed_list should be a list of Variable"
raise
TypeError
(
"feed_list should be a list of Variable"
" instead of "
+
str
(
type
(
feed_list
)))
" instead of "
+
str
(
type
(
feed_list
)))
lod_levels
=
[]
lod_levels
=
[]
...
@@ -758,7 +758,10 @@ def py_reader(capacity,
...
@@ -758,7 +758,10 @@ def py_reader(capacity,
use_double_buffer
=
use_double_buffer
)
use_double_buffer
=
use_double_buffer
)
def
py_reader_by_data
(
capacity
,
feed_list
,
name
=
None
,
use_double_buffer
=
True
):
def
create_py_reader_by_data
(
capacity
,
feed_list
,
name
=
None
,
use_double_buffer
=
True
):
"""
"""
Create a Python reader for data feeding in Python
Create a Python reader for data feeding in Python
...
@@ -781,7 +784,6 @@ def py_reader_by_data(capacity, feed_list, name=None, use_double_buffer=True):
...
@@ -781,7 +784,6 @@ def py_reader_by_data(capacity, feed_list, name=None, use_double_buffer=True):
1. The basic usage of :code:`py_reader` is as follows:
1. The basic usage of :code:`py_reader` is as follows:
>>> import paddle.v2
>>> import paddle.fluid as fluid
>>> import paddle.fluid as fluid
>>> import paddle.dataset.mnist as mnist
>>> import paddle.dataset.mnist as mnist
>>>
>>>
...
...
python/paddle/fluid/tests/unittests/test_py_reader_using_executor.py
浏览文件 @
c5292b18
...
@@ -58,7 +58,7 @@ def simple_fc_net(in_size,
...
@@ -58,7 +58,7 @@ def simple_fc_net(in_size,
if
use_feed_list
:
if
use_feed_list
:
data
=
fluid
.
layers
.
data
(
name
=
"data"
,
dtype
=
'float32'
,
shape
=
[
in_size
])
data
=
fluid
.
layers
.
data
(
name
=
"data"
,
dtype
=
'float32'
,
shape
=
[
in_size
])
label
=
fluid
.
layers
.
data
(
name
=
'label'
,
dtype
=
'int64'
,
shape
=
[
1
])
label
=
fluid
.
layers
.
data
(
name
=
'label'
,
dtype
=
'int64'
,
shape
=
[
1
])
reader
=
fluid
.
layers
.
py_reader_by_data
(
reader
=
fluid
.
layers
.
create_
py_reader_by_data
(
capacity
=
queue_capacity
,
capacity
=
queue_capacity
,
use_double_buffer
=
False
,
use_double_buffer
=
False
,
feed_list
=
[
data
,
label
])
feed_list
=
[
data
,
label
])
...
@@ -114,7 +114,8 @@ class TestPyReaderUsingExecutor(unittest.TestCase):
...
@@ -114,7 +114,8 @@ class TestPyReaderUsingExecutor(unittest.TestCase):
print
({
print
({
'use_cuda'
:
use_cuda
,
'use_cuda'
:
use_cuda
,
'use_parallel_executor'
:
use_parallel_executor
,
'use_parallel_executor'
:
use_parallel_executor
,
'use_double_buffer'
:
use_double_buffer
'use_double_buffer'
:
use_double_buffer
,
'use_feed_list'
:
use_feed_list
})
})
self
.
main
(
use_cuda
,
use_parallel_executor
,
self
.
main
(
use_cuda
,
use_parallel_executor
,
use_double_buffer
,
use_feed_list
)
use_double_buffer
,
use_feed_list
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录