Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
ffc697ff
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
ffc697ff
编写于
9月 22, 2022
作者:
Z
zyfncg
提交者:
GitHub
9月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clear extra attrs of lookup_table_v2 in OpMaker (#46321)
* clear extra attrs of look_up_table_v2 in opmaker * fix bug
上级
213427e4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
35 deletion
+8
-35
paddle/fluid/operators/lookup_table_v2_op.cc
paddle/fluid/operators/lookup_table_v2_op.cc
+0
-34
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
+1
-1
paddle/phi/api/yaml/op_compat.yaml
paddle/phi/api/yaml/op_compat.yaml
+7
-0
未找到文件。
paddle/fluid/operators/lookup_table_v2_op.cc
浏览文件 @
ffc697ff
...
...
@@ -84,46 +84,12 @@ class LookupTableV2OpMaker : public framework::OpProtoAndCheckerMaker {
"An input with type int64 "
"contains the ids to be looked up in W."
);
AddOutput
(
"Out"
,
"The lookup results, which have the same type as W."
);
AddAttr
<
bool
>
(
"is_sparse"
,
"(boolean, default false) "
"Sparse update."
)
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
bool
>
(
"is_distributed"
,
"(boolean, default false) distributed lookup table."
)
.
SetDefault
(
false
)
.
AsExtra
();
AddAttr
<
int64_t
>
(
"padding_idx"
,
"(int64, default -1) "
"If the value is -1, it makes no effect to lookup. "
"Otherwise the given value indicates padding the output "
"with zeros whenever lookup encounters it in Ids."
)
.
SetDefault
(
kNoPadding
);
// for parameter prefetch
AddAttr
<
bool
>
(
"remote_prefetch"
,
""
).
SetDefault
(
false
).
AsExtra
();
AddAttr
<
int
>
(
"trainer_id"
,
"trainer id from 0 ~ worker_num."
)
.
SetDefault
(
0
)
.
AsExtra
();
AddAttr
<
int
>
(
"slot"
,
"slot of id"
).
SetDefault
(
0
).
AsExtra
();
AddAttr
<
std
::
vector
<
int64_t
>>
(
"height_sections"
,
"Height for each output SelectedRows."
)
.
SetDefault
(
std
::
vector
<
int64_t
>
({}))
.
AsExtra
();
AddAttr
<
std
::
vector
<
std
::
string
>>
(
"epmap"
,
"(string vector, default 127.0.0.1:6164)"
"Server endpoints in the order of input variables for mapping"
)
.
SetDefault
({})
.
AsExtra
();
AddAttr
<
std
::
vector
<
std
::
string
>>
(
"table_names"
,
"(string vector, the split table names that will be fetched from "
"parameter server)"
"in the order of input variables for mapping"
)
.
SetDefault
({})
.
AsExtra
();
AddComment
(
R"DOC(
Lookup Table V2 Operator.
...
...
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
浏览文件 @
ffc697ff
...
...
@@ -59,7 +59,7 @@ ATTR_TYPE_STRING_MAP = {
def
parse_attr
(
attr_str
):
result
=
re
.
search
(
r
"(?P<attr_type>[a-z[\]]+)\s+(?P<name>[a-zA-Z0-9_]+)\s*=\s*(?P<default_val>\S+)"
,
r
"(?P<attr_type>[a-z
A-Z0-9_
[\]]+)\s+(?P<name>[a-zA-Z0-9_]+)\s*=\s*(?P<default_val>\S+)"
,
attr_str
)
return
ATTR_TYPE_STRING_MAP
[
result
.
group
(
'attr_type'
)],
result
.
group
(
'name'
),
result
.
group
(
'default_val'
)
...
...
paddle/phi/api/yaml/op_compat.yaml
浏览文件 @
ffc697ff
...
...
@@ -237,6 +237,13 @@
extra
:
attrs
:
[
bool use_mkldnn = false
]
-
op
:
embedding (lookup_table_v2)
backward
:
embedding_grad (lookup_table_v2_grad)
extra
:
attrs
:
[
bool is_sparse = false
,
bool is_distributed = false
,
bool remote_prefetch = false
,
int trainer_id = 0
,
int slot = 0
,
'
int64_t[]
height_sections
=
{}'
,
'
str[]
epmap
=
{}'
,
'
str[]
table_names
=
{}'
]
-
op
:
erf
inputs
:
x
:
X
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录