Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
53bb1265
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
53bb1265
编写于
1月 06, 2021
作者:
石
石晓伟
提交者:
GitHub
1月 06, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix a bug in op_version_registry, test=develop, test=op_version (#29994)
上级
3e0c4929
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
31 deletion
+39
-31
paddle/fluid/framework/op_version_registry.cc
paddle/fluid/framework/op_version_registry.cc
+0
-23
paddle/fluid/framework/op_version_registry.h
paddle/fluid/framework/op_version_registry.h
+33
-2
paddle/fluid/operators/conv_transpose_op.cc
paddle/fluid/operators/conv_transpose_op.cc
+4
-4
paddle/fluid/operators/fused/fusion_gru_op.cc
paddle/fluid/operators/fused/fusion_gru_op.cc
+1
-1
paddle/fluid/operators/unique_op.cc
paddle/fluid/operators/unique_op.cc
+1
-1
未找到文件。
paddle/fluid/framework/op_version_registry.cc
浏览文件 @
53bb1265
...
@@ -18,29 +18,6 @@ namespace paddle {
...
@@ -18,29 +18,6 @@ namespace paddle {
namespace
framework
{
namespace
framework
{
namespace
compatible
{
namespace
compatible
{
namespace
{
template
<
OpUpdateType
type__
,
typename
InfoType
>
OpUpdate
<
InfoType
,
type__
>*
new_update
(
InfoType
&&
info
)
{
return
new
OpUpdate
<
InfoType
,
type__
>
(
info
);
}
}
OpVersionDesc
&&
OpVersionDesc
::
ModifyAttr
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
,
const
OpAttrVariantT
&
default_value
)
{
infos_
.
emplace_back
(
new_update
<
OpUpdateType
::
kModifyAttr
>
(
OpAttrInfo
(
name
,
remark
,
default_value
)));
return
std
::
move
(
*
this
);
}
OpVersionDesc
&&
OpVersionDesc
::
NewAttr
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
,
const
OpAttrVariantT
&
default_value
)
{
infos_
.
emplace_back
(
new_update
<
OpUpdateType
::
kNewAttr
>
(
OpAttrInfo
(
name
,
remark
,
default_value
)));
return
std
::
move
(
*
this
);
}
OpVersionDesc
&&
OpVersionDesc
::
NewInput
(
const
std
::
string
&
name
,
OpVersionDesc
&&
OpVersionDesc
::
NewInput
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
)
{
const
std
::
string
&
remark
)
{
infos_
.
emplace_back
(
infos_
.
emplace_back
(
...
...
paddle/fluid/framework/op_version_registry.h
浏览文件 @
53bb1265
...
@@ -118,13 +118,44 @@ class OpUpdate : public OpUpdateBase {
...
@@ -118,13 +118,44 @@ class OpUpdate : public OpUpdateBase {
OpUpdateType
type_
;
OpUpdateType
type_
;
};
};
template
<
OpUpdateType
type__
,
typename
InfoType
>
OpUpdate
<
InfoType
,
type__
>*
new_update
(
InfoType
&&
info
)
{
return
new
OpUpdate
<
InfoType
,
type__
>
(
info
);
}
template
<
typename
T
>
OpAttrVariantT
op_attr_wrapper
(
const
T
&
val
)
{
return
OpAttrVariantT
{
val
};
}
template
<
int
N
>
OpAttrVariantT
op_attr_wrapper
(
const
char
(
&
val
)[
N
])
{
PADDLE_ENFORCE_EQ
(
val
[
N
-
1
],
0
,
platform
::
errors
::
InvalidArgument
(
"The argument of operator register %c is illegal."
,
val
[
N
-
1
]));
return
OpAttrVariantT
{
std
::
string
{
val
}};
}
class
OpVersionDesc
{
class
OpVersionDesc
{
public:
public:
/* Compatibility upgrade */
/* Compatibility upgrade */
template
<
typename
T
>
OpVersionDesc
&&
ModifyAttr
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
,
OpVersionDesc
&&
ModifyAttr
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
,
const
OpAttrVariantT
&
default_value
);
const
T
&
default_value
)
{
infos_
.
emplace_back
(
new_update
<
OpUpdateType
::
kModifyAttr
>
(
OpAttrInfo
(
name
,
remark
,
op_attr_wrapper
(
default_value
))));
return
std
::
move
(
*
this
);
}
template
<
typename
T
>
OpVersionDesc
&&
NewAttr
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
,
OpVersionDesc
&&
NewAttr
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
,
const
OpAttrVariantT
&
default_value
);
const
T
&
default_value
)
{
infos_
.
emplace_back
(
new_update
<
OpUpdateType
::
kNewAttr
>
(
OpAttrInfo
(
name
,
remark
,
op_attr_wrapper
(
default_value
))));
return
std
::
move
(
*
this
);
}
OpVersionDesc
&&
NewInput
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
);
OpVersionDesc
&&
NewInput
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
);
OpVersionDesc
&&
NewOutput
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
);
OpVersionDesc
&&
NewOutput
(
const
std
::
string
&
name
,
const
std
::
string
&
remark
);
OpVersionDesc
&&
BugfixWithBehaviorChanged
(
const
std
::
string
&
remark
);
OpVersionDesc
&&
BugfixWithBehaviorChanged
(
const
std
::
string
&
remark
);
...
...
paddle/fluid/operators/conv_transpose_op.cc
浏览文件 @
53bb1265
...
@@ -661,7 +661,7 @@ REGISTER_OP_VERSION(conv_transpose)
...
@@ -661,7 +661,7 @@ REGISTER_OP_VERSION(conv_transpose)
"output_padding"
,
"output_padding"
,
"In order to add additional size to one side of each dimension "
"In order to add additional size to one side of each dimension "
"in the output"
,
"in the output"
,
{}));
std
::
vector
<
int
>
{}));
REGISTER_OP_VERSION
(
conv2d_transpose
)
REGISTER_OP_VERSION
(
conv2d_transpose
)
.
AddCheckpoint
(
.
AddCheckpoint
(
...
@@ -672,7 +672,7 @@ REGISTER_OP_VERSION(conv2d_transpose)
...
@@ -672,7 +672,7 @@ REGISTER_OP_VERSION(conv2d_transpose)
"output_padding"
,
"output_padding"
,
"In order to add additional size to one side of each dimension "
"In order to add additional size to one side of each dimension "
"in the output"
,
"in the output"
,
{}));
std
::
vector
<
int
>
{}));
REGISTER_OP_VERSION
(
conv3d_transpose
)
REGISTER_OP_VERSION
(
conv3d_transpose
)
.
AddCheckpoint
(
.
AddCheckpoint
(
...
@@ -683,7 +683,7 @@ REGISTER_OP_VERSION(conv3d_transpose)
...
@@ -683,7 +683,7 @@ REGISTER_OP_VERSION(conv3d_transpose)
"output_padding"
,
"output_padding"
,
"In order to add additional size to one side of each dimension "
"In order to add additional size to one side of each dimension "
"in the output"
,
"in the output"
,
{}));
std
::
vector
<
int
>
{}));
REGISTER_OP_VERSION
(
depthwise_conv2d_transpose
)
REGISTER_OP_VERSION
(
depthwise_conv2d_transpose
)
.
AddCheckpoint
(
.
AddCheckpoint
(
...
@@ -694,4 +694,4 @@ REGISTER_OP_VERSION(depthwise_conv2d_transpose)
...
@@ -694,4 +694,4 @@ REGISTER_OP_VERSION(depthwise_conv2d_transpose)
"output_padding"
,
"output_padding"
,
"In order to add additional size to one side of each dimension "
"In order to add additional size to one side of each dimension "
"in the output"
,
"in the output"
,
{}));
std
::
vector
<
int
>
{}));
paddle/fluid/operators/fused/fusion_gru_op.cc
浏览文件 @
53bb1265
...
@@ -489,4 +489,4 @@ REGISTER_OP_VERSION(fusion_gru)
...
@@ -489,4 +489,4 @@ REGISTER_OP_VERSION(fusion_gru)
"Scale_weights"
,
"Scale_weights"
,
"The added attribute 'Scale_weights' is not yet "
"The added attribute 'Scale_weights' is not yet "
"registered."
,
"registered."
,
{
1.0
f
}));
std
::
vector
<
float
>
{
1.0
f
}));
paddle/fluid/operators/unique_op.cc
浏览文件 @
53bb1265
...
@@ -184,7 +184,7 @@ REGISTER_OP_VERSION(unique)
...
@@ -184,7 +184,7 @@ REGISTER_OP_VERSION(unique)
.
NewAttr
(
"axis"
,
.
NewAttr
(
"axis"
,
"The axis to apply unique. If None, the input will be "
"The axis to apply unique. If None, the input will be "
"flattened."
,
"flattened."
,
{})
std
::
vector
<
int
>
{})
.
NewAttr
(
"is_sorted"
,
.
NewAttr
(
"is_sorted"
,
"If True, the unique elements of X are in ascending order."
"If True, the unique elements of X are in ascending order."
"Otherwise, the unique elements are not sorted."
,
"Otherwise, the unique elements are not sorted."
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录