Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PALM
提交
74ac7d56
P
PALM
项目概览
PaddlePaddle
/
PALM
通知
4
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PALM
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
74ac7d56
编写于
12月 04, 2019
作者:
W
wangxiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change tensorshape
上级
acfcb1c5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
26 deletion
+26
-26
paddlepalm/_downloader.py
paddlepalm/_downloader.py
+2
-2
paddlepalm/reader/cls.py
paddlepalm/reader/cls.py
+11
-11
paddlepalm/reader/match.py
paddlepalm/reader/match.py
+11
-11
paddlepalm/reader/utils/reader4ernie.py
paddlepalm/reader/utils/reader4ernie.py
+1
-1
paddlepalm/utils/reader_helper.py
paddlepalm/utils/reader_helper.py
+1
-1
未找到文件。
paddlepalm/_downloader.py
浏览文件 @
74ac7d56
...
...
@@ -76,8 +76,8 @@ def _download(item, scope, path, silent=False):
report_hook
(
bytes_so_far
,
total_size
)
return
bytes_so_far
response
=
urlopen
(
data_url
)
_chunk_read
(
response
,
data_url
,
report_hook
=
_chunk_report
)
#
response = urlopen(data_url)
#
_chunk_read(response, data_url, report_hook=_chunk_report)
if
not
silent
:
print
(
' done!'
)
...
...
paddlepalm/reader/cls.py
浏览文件 @
74ac7d56
...
...
@@ -62,19 +62,19 @@ class Reader(reader):
@
property
def
outputs_attr
(
self
):
if
self
.
_is_training
:
return
{
"token_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
,
1
],
'float32'
],
"label_ids"
:
[[
-
1
,
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
]
return
{
"token_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
],
'float32'
],
"label_ids"
:
[[
-
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
],
'int64'
]
}
else
:
return
{
"token_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
,
1
],
'float32'
]
return
{
"token_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
],
'float32'
]
}
...
...
paddlepalm/reader/match.py
浏览文件 @
74ac7d56
...
...
@@ -60,19 +60,19 @@ class Reader(reader):
@
property
def
outputs_attr
(
self
):
if
self
.
_is_training
:
return
{
"token_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
,
1
],
'float32'
],
"label_ids"
:
[[
-
1
,
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
]
return
{
"token_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
],
'float32'
],
"label_ids"
:
[[
-
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
],
'int64'
]
}
else
:
return
{
"token_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
,
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
,
1
],
'float32'
]
return
{
"token_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"position_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"segment_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"task_ids"
:
[[
-
1
,
-
1
],
'int64'
],
"input_mask"
:
[[
-
1
,
-
1
],
'float32'
]
}
...
...
paddlepalm/reader/utils/reader4ernie.py
浏览文件 @
74ac7d56
...
...
@@ -920,7 +920,7 @@ class MRCReader(BaseReader):
batch_unique_ids
=
[
record
.
unique_id
for
record
in
batch_records
]
batch_unique_ids
=
np
.
array
(
batch_unique_ids
).
astype
(
"int64"
).
reshape
(
[
-
1
,
1
])
[
-
1
])
# padding
padded_token_ids
,
input_mask
=
pad_batch_data
(
...
...
paddlepalm/utils/reader_helper.py
浏览文件 @
74ac7d56
...
...
@@ -218,7 +218,7 @@ def merge_input_attrs(backbone_attr, task_attrs, insert_taskid=True, insert_batc
names
=
[]
start
=
0
if
insert_taskid
:
ret
.
append
(([
1
,
1
],
'int64'
))
ret
.
append
(([
1
],
'int64'
))
names
.
append
(
'__task_id'
)
start
+=
1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录