Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
c35100b0
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看板
未验证
提交
c35100b0
编写于
5月 14, 2020
作者:
F
FDInSky
提交者:
GitHub
5月 14, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test=release/1.8 update op's error info (#24541)
上级
10edacec
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
72 addition
and
29 deletion
+72
-29
paddle/fluid/operators/detection/iou_similarity_op.cc
paddle/fluid/operators/detection/iou_similarity_op.cc
+20
-8
paddle/fluid/operators/mkldnn/conv_mkldnn_op.cc
paddle/fluid/operators/mkldnn/conv_mkldnn_op.cc
+42
-17
paddle/fluid/operators/mkldnn/conv_transpose_mkldnn_op.cc
paddle/fluid/operators/mkldnn/conv_transpose_mkldnn_op.cc
+10
-4
未找到文件。
paddle/fluid/operators/detection/iou_similarity_op.cc
浏览文件 @
c35100b0
...
...
@@ -23,17 +23,29 @@ class IOUSimilarityOp : public framework::OperatorWithKernel {
protected:
void
InferShape
(
framework
::
InferShapeContext
*
ctx
)
const
override
{
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"X"
),
"Input(X) of IOUSimilarityOp should not be null."
);
PADDLE_ENFORCE
(
ctx
->
HasInput
(
"Y"
),
"Input(Y) of IOUSimilarityOp should not be null."
);
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"X"
),
"Input"
,
"X"
,
"iou_similarity"
);
OP_INOUT_CHECK
(
ctx
->
HasInput
(
"Y"
),
"Input"
,
"Y"
,
"iou_similarity"
);
auto
x_dims
=
ctx
->
GetInputDim
(
"X"
);
auto
y_dims
=
ctx
->
GetInputDim
(
"Y"
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2UL
,
"The rank of Input(X) must be 2."
);
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
4UL
,
"The shape of X is [N, 4]"
);
PADDLE_ENFORCE_EQ
(
y_dims
.
size
(),
2UL
,
"The rank of Input(Y) must be 2."
);
PADDLE_ENFORCE_EQ
(
y_dims
[
1
],
4UL
,
"The shape of Y is [M, 4]"
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2UL
,
platform
::
errors
::
InvalidArgument
(
"The rank of Input(X) must be 2, but got dimension = %d."
,
x_dims
.
size
()));
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
4UL
,
platform
::
errors
::
InvalidArgument
(
"The shape of X is [N, 4], bug got dimension = %d."
,
x_dims
[
1
]));
PADDLE_ENFORCE_EQ
(
y_dims
.
size
(),
2UL
,
platform
::
errors
::
InvalidArgument
(
"The rank of Input(Y) must be 2, but got dimension = %d."
,
y_dims
.
size
()));
PADDLE_ENFORCE_EQ
(
y_dims
[
1
],
4UL
,
platform
::
errors
::
InvalidArgument
(
"The shape of Y is [M, 4], but got dimension = %d."
,
y_dims
[
1
]));
ctx
->
ShareLoD
(
"X"
,
/*->*/
"Out"
);
ctx
->
SetOutputDim
(
"Out"
,
framework
::
make_ddim
({
x_dims
[
0
],
y_dims
[
0
]}));
...
...
paddle/fluid/operators/mkldnn/conv_mkldnn_op.cc
浏览文件 @
c35100b0
...
...
@@ -130,12 +130,18 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
auto
*
output
=
ctx
.
Output
<
Tensor
>
(
"Output"
);
PADDLE_ENFORCE_EQ
(
input
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Input tensor"
);
PADDLE_ENFORCE_NE
(
input
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Input tensor"
);
platform
::
errors
::
InvalidArgument
(
"The input tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
input
->
layout
()));
PADDLE_ENFORCE_NE
(
input
->
format
(),
MKLDNNMemoryFormat
::
undef
,
platform
::
errors
::
InvalidArgument
(
"Wrong format set for Input tensor"
));
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Filter tensor"
);
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The Filter tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
filter
->
layout
()));
PADDLE_ENFORCE_NE
(
filter
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Filter tensor"
);
...
...
@@ -154,8 +160,11 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
"Filter must be with 4 or 5 dimensions, i.e. OIHW or OIDHW"
);
if
(
bias
)
{
PADDLE_ENFORCE_EQ
(
bias
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Bias tensor"
);
PADDLE_ENFORCE_EQ
(
bias
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The Bias tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
bias
->
layout
()));
PADDLE_ENFORCE_NE
(
bias
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Bias tensor"
);
...
...
@@ -371,7 +380,9 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
auto
*
output
=
ctx
.
Output
<
Tensor
>
(
"Output"
);
PADDLE_ENFORCE_EQ
(
input
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Input tensor"
);
platform
::
errors
::
InvalidArgument
(
"The input tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
input
->
layout
()));
PADDLE_ENFORCE_NE
(
input
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Input tensor"
);
...
...
@@ -438,8 +449,11 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
auto
*
filter
=
ctx
.
Input
<
Tensor
>
(
"Filter"
);
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Filter tensor"
);
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The filter tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
filter
->
layout
()));
PADDLE_ENFORCE_NE
(
filter
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Filter tensor"
);
...
...
@@ -457,8 +471,11 @@ class ConvMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
auto
*
bias
=
ctx
.
HasInput
(
"Bias"
)
?
ctx
.
Input
<
Tensor
>
(
"Bias"
)
:
nullptr
;
if
(
bias
)
{
PADDLE_ENFORCE_EQ
(
bias
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Bias tensor"
);
PADDLE_ENFORCE_EQ
(
bias
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The bias tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
bias
->
layout
()));
PADDLE_ENFORCE_NE
(
bias
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Bias tensor"
);
...
...
@@ -743,17 +760,25 @@ class ConvMKLDNNGradOpKernel : public paddle::framework::OpKernel<T> {
Tensor
*
filter_grad
=
ctx
.
Output
<
Tensor
>
(
framework
::
GradVarName
(
"Filter"
));
PADDLE_ENFORCE_EQ
(
input
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Input tensor"
);
platform
::
errors
::
InvalidArgument
(
"The input tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
input
->
layout
()));
PADDLE_ENFORCE_NE
(
input
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Input tensor"
);
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Filter tensor"
);
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The filter tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
filter
->
layout
()));
PADDLE_ENFORCE_NE
(
filter
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Filter tensor"
);
PADDLE_ENFORCE_EQ
(
output_grad
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for output_grad tensor"
);
PADDLE_ENFORCE_EQ
(
output_grad
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The output_grad tensor's layout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
output_grad
->
layout
()));
PADDLE_ENFORCE_NE
(
output_grad
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for output_grad tensor"
);
...
...
paddle/fluid/operators/mkldnn/conv_transpose_mkldnn_op.cc
浏览文件 @
c35100b0
...
...
@@ -51,8 +51,11 @@ class ConvTransposeMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
PADDLE_ENFORCE_NE
(
input
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Input tensor"
);
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Filter tensor"
);
PADDLE_ENFORCE_EQ
(
filter
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The filter tensor's laytout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
filter
->
layout
()));
PADDLE_ENFORCE_NE
(
filter
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Filter tensor"
);
...
...
@@ -62,8 +65,11 @@ class ConvTransposeMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
"Filter must be with 4 dimensions, i.e. OIHW"
);
if
(
bias
)
{
PADDLE_ENFORCE_EQ
(
bias
->
layout
(),
DataLayout
::
kMKLDNN
,
"Wrong layout set for Bias tensor"
);
PADDLE_ENFORCE_EQ
(
bias
->
layout
(),
DataLayout
::
kMKLDNN
,
platform
::
errors
::
InvalidArgument
(
"The bias tensor's laytout should be %d, but got %d."
,
DataLayout
::
kMKLDNN
,
bias
->
layout
()));
PADDLE_ENFORCE_NE
(
bias
->
format
(),
MKLDNNMemoryFormat
::
undef
,
"Wrong format set for Bias tensor"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录