Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
1d11cac2
Mace
项目概览
Xiaomi
/
Mace
通知
107
Star
40
Fork
27
代码
文件
提交
分支
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看板
提交
1d11cac2
编写于
2月 11, 2019
作者:
W
w-adamski
提交者:
Liangliang He
2月 11, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added sqrt() to tensorflow converter (#343)
上级
fef913af
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
1 deletion
+8
-1
docs/user_guide/op_lists.rst
docs/user_guide/op_lists.rst
+1
-1
mace/python/tools/converter_tool/tensorflow_converter.py
mace/python/tools/converter_tool/tensorflow_converter.py
+7
-0
未找到文件。
docs/user_guide/op_lists.rst
浏览文件 @
1d11cac2
...
...
@@ -20,7 +20,7 @@ Operator lists
"DEPTHWISE_CONV_2D","Y","Only multiplier = 1 is supported; Fusion is supported."
"DEPTH_TO_SPACE","Y",""
"DEQUANTIZE","Y","Model quantization will be supported later."
"ELEMENT_WISE","Y","ADD/MUL/DIV/MIN/MAX/NEG/ABS/SQR_DIFF/POW/RSQRT/EQUAL"
"ELEMENT_WISE","Y","ADD/MUL/DIV/MIN/MAX/NEG/ABS/SQR_DIFF/POW/RSQRT/
SQRT/
EQUAL"
"EMBEDDING_LOOKUP","Y",""
"EXPANDDIMS","Y","Only CPU and TensorFlow is supported."
"FILL","Y","Only CPU and TensorFlow is supported."
...
...
mace/python/tools/converter_tool/tensorflow_converter.py
浏览文件 @
1d11cac2
...
...
@@ -113,6 +113,7 @@ TFSupportedOps = [
'ArgMax'
,
'Split'
,
'FakeQuantWithMinMaxVars'
,
'Sqrt'
,
]
TFOpType
=
Enum
(
'TFOpType'
,
[(
op
,
op
)
for
op
in
TFSupportedOps
],
type
=
str
)
...
...
@@ -187,6 +188,7 @@ class TensorflowConverter(base_converter.ConverterInterface):
TFOpType
.
SquaredDifference
.
name
:
EltwiseType
.
SQR_DIFF
,
TFOpType
.
Square
.
name
:
EltwiseType
.
POW
,
TFOpType
.
Rsqrt
.
name
:
EltwiseType
.
POW
,
TFOpType
.
Sqrt
.
name
:
EltwiseType
.
POW
,
TFOpType
.
Equal
.
name
:
EltwiseType
.
EQUAL
,
}
...
...
@@ -262,6 +264,7 @@ class TensorflowConverter(base_converter.ConverterInterface):
TFOpType
.
ArgMax
.
name
:
self
.
convert_argmax
,
TFOpType
.
Split
.
name
:
self
.
convert_split
,
TFOpType
.
FakeQuantWithMinMaxVars
.
name
:
self
.
convert_fake_quantize
,
TFOpType
.
Sqrt
.
name
:
self
.
convert_elementwise
,
}
self
.
_option
=
option
self
.
_mace_net_def
=
mace_pb2
.
NetDef
()
...
...
@@ -509,6 +512,10 @@ class TensorflowConverter(base_converter.ConverterInterface):
value_arg
=
op
.
arg
.
add
()
value_arg
.
name
=
MaceKeyword
.
mace_scalar_input_str
value_arg
.
f
=
-
0.5
elif
tf_op
.
type
==
TFOpType
.
Sqrt
:
value_arg
=
op
.
arg
.
add
()
value_arg
.
name
=
MaceKeyword
.
mace_scalar_input_str
value_arg
.
f
=
0.5
if
type_arg
.
i
!=
EltwiseType
.
NEG
.
value
\
and
type_arg
.
i
!=
EltwiseType
.
ABS
.
value
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录