Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
毕竟曾有刹那
Mace
提交
d8bdd9bf
Mace
项目概览
毕竟曾有刹那
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d8bdd9bf
编写于
8月 14, 2019
作者:
L
liutuo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix onnx deconv
上级
708aa21e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
14 addition
and
13 deletion
+14
-13
mace/core/types.h
mace/core/types.h
+1
-0
mace/ops/deconv_2d.cc
mace/ops/deconv_2d.cc
+13
-13
未找到文件。
mace/core/types.h
浏览文件 @
d8bdd9bf
...
...
@@ -64,6 +64,7 @@ MACE_MAPPING_DATA_TYPE_AND_ENUM(int32_t, DT_INT32);
enum
FrameworkType
{
TENSORFLOW
=
0
,
CAFFE
=
1
,
ONNX
=
2
,
};
template
<
typename
T
>
...
...
mace/ops/deconv_2d.cc
浏览文件 @
d8bdd9bf
...
...
@@ -66,12 +66,12 @@ class Deconv2dOp<DeviceType::CPU, float> : public Deconv2dOpBase {
const
Tensor
*
filter
=
this
->
Input
(
1
);
const
Tensor
*
bias
=
nullptr
;
const
Tensor
*
output_shape_tensor
=
nullptr
;
if
(
model_type_
==
CAFFE
)
{
bias
=
this
->
InputSize
()
>=
3
?
this
->
Input
(
2
)
:
nullptr
;
}
else
{
if
(
model_type_
==
TENSORFLOW
)
{
output_shape_tensor
=
this
->
InputSize
()
>=
3
?
this
->
Input
(
2
)
:
nullptr
;
bias
=
this
->
InputSize
()
>=
4
?
this
->
Input
(
3
)
:
nullptr
;
}
else
{
bias
=
this
->
InputSize
()
>=
3
?
this
->
Input
(
2
)
:
nullptr
;
}
Tensor
*
output
=
this
->
Output
(
0
);
...
...
@@ -182,13 +182,7 @@ class Deconv2dOp<DeviceType::GPU, float> : public Deconv2dOpBase {
context
,
operator_def_
.
get
(),
1
,
OpenCLBufferType
::
CONV2D_FILTER
,
mem_type
)
==
MaceStatus
::
MACE_SUCCESS
);
if
(
model_type_
==
FrameworkType
::
CAFFE
)
{
if
(
operator_def_
->
input_size
()
>=
3
)
{
MACE_CHECK
(
TransformFilter
(
context
,
operator_def_
.
get
(),
2
,
OpenCLBufferType
::
ARGUMENT
,
mem_type
)
==
MaceStatus
::
MACE_SUCCESS
);
}
}
else
{
if
(
model_type_
==
FrameworkType
::
TENSORFLOW
)
{
if
(
operator_def_
->
input_size
()
>=
4
)
{
MACE_CHECK
(
TransformFilter
(
context
,
...
...
@@ -197,6 +191,12 @@ class Deconv2dOp<DeviceType::GPU, float> : public Deconv2dOpBase {
OpenCLBufferType
::
ARGUMENT
,
mem_type
)
==
MaceStatus
::
MACE_SUCCESS
);
}
}
else
{
if
(
operator_def_
->
input_size
()
>=
3
)
{
MACE_CHECK
(
TransformFilter
(
context
,
operator_def_
.
get
(),
2
,
OpenCLBufferType
::
ARGUMENT
,
mem_type
)
==
MaceStatus
::
MACE_SUCCESS
);
}
}
}
MaceStatus
Run
(
OpContext
*
context
)
override
{
...
...
@@ -204,12 +204,12 @@ class Deconv2dOp<DeviceType::GPU, float> : public Deconv2dOpBase {
const
Tensor
*
filter
=
this
->
Input
(
1
);
const
Tensor
*
bias
=
nullptr
;
const
Tensor
*
output_shape_tensor
=
nullptr
;
if
(
model_type_
==
CAFFE
)
{
bias
=
this
->
InputSize
()
>=
3
?
this
->
Input
(
2
)
:
nullptr
;
}
else
{
if
(
model_type_
==
TENSORFLOW
)
{
output_shape_tensor
=
this
->
InputSize
()
>=
3
?
this
->
Input
(
2
)
:
nullptr
;
bias
=
this
->
InputSize
()
>=
4
?
this
->
Input
(
3
)
:
nullptr
;
}
else
{
bias
=
this
->
InputSize
()
>=
3
?
this
->
Input
(
2
)
:
nullptr
;
}
Tensor
*
output
=
this
->
Output
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录