Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
毕竟曾有刹那
Mace
提交
3e8e6647
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,发现更多精彩内容 >>
提交
3e8e6647
编写于
10月 08, 2018
作者:
L
liutuo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix deconv fold activation
上级
c2523ee2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
3 deletion
+12
-3
mace/ops/deconv_2d.h
mace/ops/deconv_2d.h
+5
-2
mace/python/tools/converter_tool/tensorflow_converter.py
mace/python/tools/converter_tool/tensorflow_converter.py
+6
-0
mace/python/tools/converter_tool/transformer.py
mace/python/tools/converter_tool/transformer.py
+1
-1
未找到文件。
mace/ops/deconv_2d.h
浏览文件 @
3e8e6647
...
...
@@ -16,6 +16,7 @@
#define MACE_OPS_DECONV_2D_H_
#include <memory>
#include <string>
#include "mace/core/operator.h"
#include "mace/kernels/deconv_2d.h"
...
...
@@ -34,8 +35,10 @@ class Deconv2dOp : public Operator<D, T> {
"padding"
,
static_cast
<
int
>
(
SAME
))),
OperatorBase
::
GetRepeatedArgs
<
int
>
(
"padding_values"
),
OperatorBase
::
GetRepeatedArgs
<
index_t
>
(
"output_shape"
),
kernels
::
ActivationType
::
NOOP
,
0.0
f
)
{}
kernels
::
StringToActivationType
(
OperatorBase
::
GetOptionalArg
<
std
::
string
>
(
"activation"
,
"NOOP"
)),
OperatorBase
::
GetOptionalArg
<
float
>
(
"max_limit"
,
0.0
f
))
{}
MaceStatus
Run
(
StatsFuture
*
future
)
override
{
const
Tensor
*
input
=
this
->
Input
(
INPUT
);
...
...
mace/python/tools/converter_tool/tensorflow_converter.py
浏览文件 @
3e8e6647
...
...
@@ -403,6 +403,12 @@ class TensorflowConverter(base_converter.ConverterInterface):
dilation_val
=
[
1
,
1
]
dilation_arg
.
ints
.
extend
(
dilation_val
)
else
:
try
:
dilation_val
=
tf_op
.
get_attr
(
tf_dilations_str
)[
1
:
3
]
except
ValueError
:
dilation_val
=
[
1
,
1
]
mace_check
(
dilation_val
[
0
]
==
1
and
dilation_val
[
1
]
==
1
,
"Mace only supports dilation == 1 conv2d_transpose."
)
mace_check
(
len
(
tf_op
.
inputs
)
>=
3
,
"deconv should have (>=) 3 inputs."
)
output_shape_arg
=
op
.
arg
.
add
()
...
...
mace/python/tools/converter_tool/transformer.py
浏览文件 @
3e8e6647
...
...
@@ -950,13 +950,13 @@ class Transformer(base_converter.ConverterInterface):
return
False
def
reshape_fc_weight
(
self
):
print
(
"Reshape fully connected weight shape"
)
net
=
self
.
_model
filter_format
=
self
.
filter_format
()
for
op
in
net
.
op
:
if
op
.
type
==
MaceOp
.
FullyConnected
.
name
:
weight
=
self
.
_consts
[
op
.
input
[
1
]]
if
len
(
weight
.
dims
)
==
2
:
print
(
"Reshape fully connected weight shape"
)
input_op
=
self
.
_producer
[
op
.
input
[
0
]]
input_shape
=
list
(
input_op
.
output_shape
[
0
].
dims
)
weight
.
dims
[:]
=
[
weight
.
dims
[
0
]]
+
input_shape
[
1
:]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录