Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
29bb1208
X
X2Paddle
项目概览
PaddlePaddle
/
X2Paddle
大约 1 年 前同步成功
通知
328
Star
698
Fork
167
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
26
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
X2Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
26
Issue
26
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
29bb1208
编写于
7月 08, 2021
作者:
W
WJJ1995
提交者:
GitHub
7月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add ONNX ReduceL1/L2 op and fixed clip op (#635)
* add ReduceL1/L2 op and fixed clip op * remove print * fixed comments
上级
fd0205c4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
37 addition
and
10 deletion
+37
-10
x2paddle/decoder/tf_decoder.py
x2paddle/decoder/tf_decoder.py
+0
-1
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
+37
-9
未找到文件。
x2paddle/decoder/tf_decoder.py
浏览文件 @
29bb1208
...
@@ -99,7 +99,6 @@ class TFGraphNode(GraphNode):
...
@@ -99,7 +99,6 @@ class TFGraphNode(GraphNode):
@
property
@
property
def
name
(
self
):
def
name
(
self
):
if
hasattr
(
self
,
'index'
):
if
hasattr
(
self
,
'index'
):
print
(
self
.
layer_type
)
return
self
.
layer_name
+
"_p{}"
.
format
(
self
.
index
)
return
self
.
layer_name
+
"_p{}"
.
format
(
self
.
index
)
return
self
.
layer_name
return
self
.
layer_name
...
...
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
浏览文件 @
29bb1208
...
@@ -1173,15 +1173,15 @@ class OpSet9():
...
@@ -1173,15 +1173,15 @@ class OpSet9():
max_value
=
max_value
[
0
]
max_value
=
max_value
[
0
]
if
min_value
.
shape
==
(
1
,
):
if
min_value
.
shape
==
(
1
,
):
min_value
=
min_value
[
0
]
min_value
=
min_value
[
0
]
if
max_value
is
not
None
and
min_value
is
not
None
:
if
max_value
is
not
None
and
min_value
is
not
None
:
layer_attrs
=
{
'max'
:
max_value
,
'min'
:
min_value
}
layer_attrs
=
{
'max'
:
max_value
,
'min'
:
min_value
}
self
.
paddle_graph
.
add_layer
(
self
.
paddle_graph
.
add_layer
(
'paddle.clip'
,
'paddle.clip'
,
inputs
=
{
"x"
:
val_x
.
name
},
inputs
=
{
"x"
:
val_x
.
name
},
outputs
=
[
node
.
name
],
outputs
=
[
node
.
name
],
**
layer_attrs
)
**
layer_attrs
)
else
:
else
:
raise
raise
Exception
(
"max_value or min_value can't be None"
)
@
print_mapping_info
@
print_mapping_info
def
Split
(
self
,
node
):
def
Split
(
self
,
node
):
...
@@ -2226,3 +2226,31 @@ class OpSet9():
...
@@ -2226,3 +2226,31 @@ class OpSet9():
"scores"
:
scores
.
name
},
"scores"
:
scores
.
name
},
outputs
=
layer_outputs
,
outputs
=
layer_outputs
,
**
layer_attrs
)
**
layer_attrs
)
@
print_mapping_info
def
ReduceL1
(
self
,
node
):
output_name
=
node
.
name
layer_outputs
=
[
output_name
]
val_x
=
self
.
graph
.
get_input_node
(
node
,
idx
=
0
,
copy
=
True
)
axes
=
node
.
get_attr
(
'axes'
)
keepdims
=
False
if
node
.
get_attr
(
'keepdims'
)
==
0
else
True
layer_attrs
=
{
'p'
:
1
,
'axis'
:
axes
,
'keepdim'
:
keepdims
}
self
.
paddle_graph
.
add_layer
(
"paddle.norm"
,
inputs
=
{
"x"
:
val_x
.
name
},
outputs
=
layer_outputs
,
**
layer_attrs
)
@
print_mapping_info
def
ReduceL2
(
self
,
node
):
output_name
=
node
.
name
layer_outputs
=
[
output_name
]
val_x
=
self
.
graph
.
get_input_node
(
node
,
idx
=
0
,
copy
=
True
)
axes
=
node
.
get_attr
(
'axes'
)
keepdims
=
False
if
node
.
get_attr
(
'keepdims'
)
==
0
else
True
layer_attrs
=
{
'p'
:
2
,
'axis'
:
axes
,
'keepdim'
:
keepdims
}
self
.
paddle_graph
.
add_layer
(
"paddle.norm"
,
inputs
=
{
"x"
:
val_x
.
name
},
outputs
=
layer_outputs
,
**
layer_attrs
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录