Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
9e67850f
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9e67850f
编写于
8月 10, 2020
作者:
Y
yangruoqi713
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MS][LITE] fix bug of arm cpu fp32 conv_depthwise: only support group equals output channel
上级
d46a0e4d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
3 deletion
+13
-3
mindspore/lite/src/ops/convolution_depthwise.cc
mindspore/lite/src/ops/convolution_depthwise.cc
+5
-0
mindspore/lite/src/ops/deconvolution_depthwise.cc
mindspore/lite/src/ops/deconvolution_depthwise.cc
+5
-0
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc
.../lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc
+1
-1
mindspore/lite/tools/converter/parser/caffe/caffe_convolution_parser.cc
.../tools/converter/parser/caffe/caffe_convolution_parser.cc
+1
-1
mindspore/lite/tools/converter/parser/caffe/caffe_deconvolution_parser.cc
...ools/converter/parser/caffe/caffe_deconvolution_parser.cc
+1
-1
未找到文件。
mindspore/lite/src/ops/convolution_depthwise.cc
浏览文件 @
9e67850f
...
...
@@ -40,6 +40,7 @@ int DepthwiseConv2D::InferShape(std::vector<tensor::Tensor *> inputs_, std::vect
auto
in_shape
=
input
->
shape
();
int
input_h
=
in_shape
.
at
(
1
);
int
input_w
=
in_shape
.
at
(
2
);
int
input_channel
=
in_shape
.
at
(
3
);
int
output_w
=
0
,
output_h
=
0
;
auto
conv_prim
=
this
->
primitive
->
value_as_DepthwiseConv2D
();
...
...
@@ -69,6 +70,10 @@ int DepthwiseConv2D::InferShape(std::vector<tensor::Tensor *> inputs_, std::vect
std
::
vector
<
int
>
out_shape
{
input
->
shape
()};
out_shape
.
at
(
1
)
=
output_h
;
out_shape
.
at
(
2
)
=
output_w
;
if
(
conv_prim
->
channelMultiplier
()
*
input_channel
!=
weight
->
shape
()[
0
])
{
MS_LOG
(
ERROR
)
<<
"Conv depthwise only support group equals output channel."
;
return
RET_ERROR
;
}
out_shape
.
at
(
3
)
=
weight
->
shape
()[
0
]
*
weight
->
shape
()[
3
];
// in_channel * out_channel
output
->
set_shape
(
out_shape
);
...
...
mindspore/lite/src/ops/deconvolution_depthwise.cc
浏览文件 @
9e67850f
...
...
@@ -40,6 +40,7 @@ int DeconvDepthwiseConv2D::InferShape(std::vector<tensor::Tensor *> inputs_, std
auto
in_shape
=
input
->
shape
();
int
input_h
=
in_shape
.
at
(
1
);
int
input_w
=
in_shape
.
at
(
2
);
int
input_channel
=
in_shape
.
at
(
3
);
int
output_w
=
0
,
output_h
=
0
;
auto
conv_prim
=
this
->
primitive
->
value_as_DeDepthwiseConv2D
();
...
...
@@ -58,6 +59,10 @@ int DeconvDepthwiseConv2D::InferShape(std::vector<tensor::Tensor *> inputs_, std
std
::
vector
<
int
>
out_shape
{
input
->
shape
()};
out_shape
.
at
(
1
)
=
output_h
;
out_shape
.
at
(
2
)
=
output_w
;
if
(
conv_prim
->
channelMultiplier
()
*
input_channel
!=
weight
->
shape
()[
0
])
{
MS_LOG
(
ERROR
)
<<
"Conv depthwise only support group equals output channel."
;
return
RET_ERROR
;
}
out_shape
.
at
(
3
)
=
weight
->
shape
()[
0
]
*
weight
->
shape
()[
3
];
// in_channel * out_channel
output
->
set_shape
(
out_shape
);
...
...
mindspore/lite/src/runtime/kernel/arm/nnacl/fp32/conv_depthwise.cc
浏览文件 @
9e67850f
...
...
@@ -53,7 +53,7 @@ void InitSlidingParam(SlidingWindowParam *sliding, const ConvParameter *conv_par
sliding
->
in_step_
=
conv_param
->
input_h_
*
conv_param
->
input_w_
*
sliding
->
block_channel_
;
// for batch loop
sliding
->
in_h_step_
=
conv_param
->
input_w_
*
sliding
->
block_channel_
;
sliding
->
in_sh_step_
=
conv_param
->
input_w_
*
sliding
->
block_channel_
*
conv_param
->
stride_h_
;
// stride H
sliding
->
in_sw_step_
=
sliding
->
block_channel_
*
conv_param
->
stride_
h
_
;
// stride W
sliding
->
in_sw_step_
=
sliding
->
block_channel_
*
conv_param
->
stride_
w
_
;
// stride W
sliding
->
in_kh_step_
=
conv_param
->
input_w_
*
sliding
->
block_channel_
*
conv_param
->
dilation_h_
;
// kernel H
sliding
->
in_kw_step_
=
sliding
->
block_channel_
*
conv_param
->
dilation_w_
;
// kernel W
sliding
->
kernel_step_
=
conv_param
->
kernel_w_
*
conv_param
->
kernel_h_
*
block
;
...
...
mindspore/lite/tools/converter/parser/caffe/caffe_convolution_parser.cc
浏览文件 @
9e67850f
...
...
@@ -20,7 +20,7 @@
namespace
mindspore
{
namespace
lite
{
void
CaffeConvolutionParser
::
ParseGroupConvolution
(
schema
::
CNodeT
*
op
,
schema
::
Conv2DT
*
attr
)
{
if
(
attr
==
nullptr
||
attr
->
group
==
1
||
attr
->
group
!=
attr
->
channelOut
)
{
if
(
attr
==
nullptr
||
attr
->
group
==
1
)
{
return
;
}
std
::
unique_ptr
<
schema
::
DepthwiseConv2DT
>
depthwiseConv2DParam
(
new
schema
::
DepthwiseConv2DT
());
...
...
mindspore/lite/tools/converter/parser/caffe/caffe_deconvolution_parser.cc
浏览文件 @
9e67850f
...
...
@@ -20,7 +20,7 @@
namespace
mindspore
{
namespace
lite
{
void
CaffeDeconvolutionParser
::
ParseGroupDeconvolution
(
schema
::
CNodeT
*
op
,
schema
::
DeConv2DT
*
attr
)
{
if
(
attr
==
nullptr
||
attr
->
group
==
1
||
attr
->
group
!=
attr
->
channelIn
)
{
if
(
attr
==
nullptr
||
attr
->
group
==
1
)
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录