Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
61cc842a
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2305
Star
20932
Fork
5423
代码
文件
提交
分支
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看板
提交
61cc842a
编写于
4月 16, 2019
作者:
L
Leo Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
disable test_elementwise_mul_mkldnn_op case
上级
a9694bd3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
8 deletion
+4
-8
paddle/fluid/operators/elementwise/mkldnn/elementwise_mul_mkldnn_op.cc
...operators/elementwise/mkldnn/elementwise_mul_mkldnn_op.cc
+0
-7
python/paddle/fluid/tests/unittests/mkldnn/test_elementwise_mul_mkldnn_op.py
.../tests/unittests/mkldnn/test_elementwise_mul_mkldnn_op.py
+4
-1
未找到文件。
paddle/fluid/operators/elementwise/mkldnn/elementwise_mul_mkldnn_op.cc
浏览文件 @
61cc842a
...
...
@@ -130,13 +130,6 @@ class ElementwiseMulMKLDNNKernel : public framework::OpKernel<T> {
z
->
set_layout
(
DataLayout
::
kMKLDNN
);
z
->
set_format
(
x
->
format
());
// convert to nchw format to align with native version
using
platform
::
MKLDNNDeviceContext
;
auto
&
dev_ctx
=
ctx
.
template
device_context
<
MKLDNNDeviceContext
>();
const
auto
&
mkldnn_engine
=
dev_ctx
.
GetEngine
();
ReorderInput
<
T
>
(
const_cast
<
Tensor
*>
(
z
),
ctx
.
GetPlace
(),
mkldnn_engine
,
z
->
dims
().
size
()
==
4
);
}
else
{
// Fallback to naive version:
const
bool
are_inputs_in_same_format
=
x
->
format
()
==
y
->
format
();
...
...
python/paddle/fluid/tests/unittests/mkldnn/test_elementwise_mul_mkldnn_op.py
浏览文件 @
61cc842a
...
...
@@ -21,6 +21,9 @@ from paddle.fluid.op import Operator
from
paddle.fluid.tests.unittests.test_elementwise_mul_op
import
*
# TODO(LeoZhao-Intel): re-enable this case
# https://github.com/PaddlePaddle/Paddle/issues/16764
@
unittest
.
skip
(
"Not supported well on avx2."
)
class
TestElementwiseMulMKLDNNOp_BroadcastNCHW16c
(
ElementwiseMulOp
):
def
init_input_output
(
self
):
x
=
np
.
random
.
rand
(
1
,
16
,
2
,
2
).
astype
(
self
.
dtype
)
...
...
@@ -29,7 +32,7 @@ class TestElementwiseMulMKLDNNOp_BroadcastNCHW16c(ElementwiseMulOp):
self
.
out
=
x
*
self
.
y
.
reshape
(
1
,
16
,
1
,
1
)
#
self.out = self.out.transpose(0, 2, 3, 1).reshape(1, 16, 2, 2)
self
.
out
=
self
.
out
.
transpose
(
0
,
2
,
3
,
1
).
reshape
(
1
,
16
,
2
,
2
)
def
setUp
(
self
):
super
(
TestElementwiseMulMKLDNNOp_BroadcastNCHW16c
,
self
).
setUp
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录