Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
5fc2cfba
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
5fc2cfba
编写于
10月 10, 2019
作者:
H
huzhiqiang
提交者:
GitHub
10月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify map_reader en test=develop (#20229)
* modify map_reader en test=develop
上级
4ba6d062
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
27 addition
and
7 deletion
+27
-7
paddle/fluid/API.spec
paddle/fluid/API.spec
+1
-1
python/paddle/reader/decorator.py
python/paddle/reader/decorator.py
+26
-6
未找到文件。
paddle/fluid/API.spec
浏览文件 @
5fc2cfba
...
...
@@ -94,7 +94,7 @@ paddle.fluid.io.DataLoader.__init__
paddle.fluid.io.DataLoader.from_dataset (ArgSpec(args=['dataset', 'places', 'drop_last'], varargs=None, keywords=None, defaults=(True,)), ('document', 'eb8b6d31e1c2ec2ca8ebbb62fcf46557'))
paddle.fluid.io.DataLoader.from_generator (ArgSpec(args=['feed_list', 'capacity', 'use_double_buffer', 'iterable', 'return_list'], varargs=None, keywords=None, defaults=(None, None, True, True, False)), ('document', 'e3bdde36774236c3e381d2218e9cc09e'))
paddle.fluid.io.cache (ArgSpec(args=['reader'], varargs=None, keywords=None, defaults=None), ('document', '1676886070eb607cb608f7ba47be0d3c'))
paddle.fluid.io.map_readers (ArgSpec(args=['func'], varargs='readers', keywords=None, defaults=None), ('document', '
77cbadb09df588e21e5cc0819b69c87d
'))
paddle.fluid.io.map_readers (ArgSpec(args=['func'], varargs='readers', keywords=None, defaults=None), ('document', '
2d0903e1d2f00b4f1d6618e6b5310121
'))
paddle.fluid.io.buffered (ArgSpec(args=['reader', 'size'], varargs=None, keywords=None, defaults=None), ('document', '0d6186f109feceb99f60ec50a0a624cb'))
paddle.fluid.io.compose (ArgSpec(args=[], varargs='readers', keywords='kwargs', defaults=None), ('document', '884291104e1c3f37f33aae44b7deeb0d'))
paddle.fluid.io.chain (ArgSpec(args=[], varargs='readers', keywords=None, defaults=None), ('document', 'e0311508658a7e741fc39feea8be0ad2'))
...
...
python/paddle/reader/decorator.py
浏览文件 @
5fc2cfba
...
...
@@ -61,13 +61,33 @@ def cache(reader):
def
map_readers
(
func
,
*
readers
):
"""
Creates a data reader that outputs return value of function using
output of each data reader
s
as arguments.
output of each data reader as arguments.
:param func: function to use. The type of func should be (Sample) => Sample
:type: callable
:param readers: readers whose outputs will be used as arguments of func.
:return: the created data reader.
:rtype: callable
If input readers output the following data entries: 2 3,
and the input func is mul(x, y),
the output of the resulted reader will be 6.
Args:
func: a function to read data and compute result, the output of this function
will be set as the output of the resulted data reader.
readers (Reader|list of Reader): list of readers whose outputs will be used as arguments of func.
Returns:
the resulted data reader (Reader)
Examples:
.. code-block:: python
import paddle.reader
d = {"h": 0, "i": 1}
def func(x):
return d[x]
def reader():
yield "h"
yield "i"
map_reader_result = paddle.reader.map_readers(func, reader)
"""
def
reader
():
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录