Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
638d924d
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看板
未验证
提交
638d924d
编写于
4月 07, 2020
作者:
Z
zhangchunle
提交者:
GitHub
4月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Op (FusionSquaredMatSub) error message enhancement. (#23498)
上级
660489ac
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
27 deletion
+26
-27
paddle/fluid/operators/fused/fused_embedding_seq_pool_op.cc
paddle/fluid/operators/fused/fused_embedding_seq_pool_op.cc
+0
-6
paddle/fluid/operators/fused/fusion_squared_mat_sub_op.cc
paddle/fluid/operators/fused/fusion_squared_mat_sub_op.cc
+26
-21
未找到文件。
paddle/fluid/operators/fused/fused_embedding_seq_pool_op.cc
浏览文件 @
638d924d
...
...
@@ -38,12 +38,6 @@ class FusedEmbeddingSeqPoolOp : public framework::OperatorWithKernel {
"The dim size of the input tensor 'W' should be 2. "
"But received W's size = %d."
,
table_dims
.
size
()));
PADDLE_ENFORCE_GE
(
ids_dims
.
size
(),
1
,
platform
::
errors
::
InvalidArgument
(
"The dim size of the input tensor 'Ids' should be greater "
"than or equal to 1. But received Ids's size = %d."
,
ids_dims
.
size
()));
PADDLE_ENFORCE_EQ
(
ids_dims
[
ids_dims
.
size
()
-
1
],
1
,
platform
::
errors
::
InvalidArgument
(
...
...
paddle/fluid/operators/fused/fusion_squared_mat_sub_op.cc
浏览文件 @
638d924d
...
...
@@ -22,29 +22,34 @@ namespace operators {
void
FusionSquaredMatSubOp
::
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
{
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"X"
),
"Input(X) of FusionSquaredMatSubOp should not be null."
);
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"Y"
),
"Input(Y) of FusionSquaredMatSubOp should not be null."
);
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"SquaredX"
),
"Output(SquaredX) of FusionSquaredMatSubOp should not be null."
);
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"SquaredY"
),
"Output(SquaredY) of FusionSquaredMatSubOp should not be null."
);
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"SquaredXY"
),
"Output(SquaredXY) of FusionSquaredMatSubOp should not be null."
);
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"Out"
),
"Output(Out) of FusionSquaredMatSubOp should not be null."
);
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"X"
),
"Input"
,
"X"
,
"FusionSquaredMatSub"
);
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"Y"
),
"Input"
,
"Y"
,
"FusionSquaredMatSub"
);
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"SquaredX"
),
"SquaredX"
,
"Out"
,
"FusionSquaredMatSub"
);
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"SquaredY"
),
"SquaredY"
,
"Out"
,
"FusionSquaredMatSub"
);
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"SquaredXY"
),
"SquaredXY"
,
"Out"
,
"FusionSquaredMatSub"
);
OP_INOUT_CHECK
(
ctx
->
HasOutput
(
"Out"
),
"Out"
,
"Out"
,
"FusionSquaredMatSub"
);
auto
x_dims
=
ctx
->
GetInputDim
(
"X"
);
auto
y_dims
=
ctx
->
GetInputDim
(
"Y"
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
y_dims
.
size
(),
"Input tensors dims size should be equal."
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2
,
"Input tensors should be a Matrix."
);
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
y_dims
[
0
],
"Inputs Matrix should be multiply."
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
y_dims
.
size
(),
platform
::
errors
::
InvalidArgument
(
"The input tensor X's dims size should "
"be equal to Y's. But received X's "
"dims size = %d, Y's dims size = %d."
,
x_dims
.
size
(),
y_dims
.
size
()));
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2
,
platform
::
errors
::
InvalidArgument
(
"The input tensor X's dims size should be 2. But "
"received X's dims size = %d."
,
x_dims
.
size
()));
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
y_dims
[
0
],
platform
::
errors
::
InvalidArgument
(
"The input tensor X's dims[1] should "
"be equal to Y's dims[0]. But received "
"X's dims[1] = %d, Y's dims[0] = %d."
,
x_dims
[
1
],
y_dims
[
0
]));
ctx
->
SetOutputDim
(
"SquaredX"
,
x_dims
);
ctx
->
SetOutputDim
(
"SquaredY"
,
y_dims
);
ctx
->
SetOutputDim
(
"SquaredXY"
,
{
x_dims
[
0
],
y_dims
[
1
]});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录