Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
4a524a8a
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看板
未验证
提交
4a524a8a
编写于
8月 07, 2020
作者:
J
Jason
提交者:
GitHub
8月 07, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #354 from Channingss/prior_box
fix bug of elementwise_ops
上级
01cb5b20
cafb4c66
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
7 deletion
+10
-7
x2paddle/op_mapper/paddle2onnx/opset9/opset.py
x2paddle/op_mapper/paddle2onnx/opset9/opset.py
+10
-7
未找到文件。
x2paddle/op_mapper/paddle2onnx/opset9/opset.py
浏览文件 @
4a524a8a
...
...
@@ -174,14 +174,15 @@ class OpSet9(object):
inputs
=
[
op
.
input
(
'X'
)[
0
],
temp_value
],
outputs
=
op
.
output
(
'Out'
))
return
[
shape_node
,
y_node
,
node
]
elif
len
(
x_shape
)
==
len
(
y_shape
):
elif
axis
==
-
1
or
axis
==
(
len
(
x_shape
)
-
1
)
or
len
(
x_shape
)
==
len
(
y_shape
):
node
=
helper
.
make_node
(
'Add'
,
inputs
=
[
op
.
input
(
'X'
)[
0
],
op
.
input
(
'Y'
)[
0
]],
outputs
=
op
.
output
(
'Out'
))
return
node
else
:
raise
Exc
pe
tion
(
"Unexpected situation happend in elementwise_add"
)
raise
Exc
ep
tion
(
"Unexpected situation happend in elementwise_add"
)
def
elementwise_sub
(
self
,
op
,
block
):
axis
=
op
.
attr
(
'axis'
)
...
...
@@ -203,14 +204,15 @@ class OpSet9(object):
inputs
=
[
op
.
input
(
'X'
)[
0
],
temp_value
],
outputs
=
op
.
output
(
'Out'
))
return
[
shape_node
,
y_node
,
node
]
elif
len
(
x_shape
)
==
len
(
y_shape
):
elif
axis
==
-
1
or
axis
==
(
len
(
x_shape
)
-
1
)
or
len
(
x_shape
)
==
len
(
y_shape
):
node
=
helper
.
make_node
(
'Sub'
,
inputs
=
[
op
.
input
(
'X'
)[
0
],
op
.
input
(
'Y'
)[
0
]],
outputs
=
op
.
output
(
'Out'
))
return
node
else
:
raise
Exc
pe
tion
(
"Unexpected situation happend in elementwise_sub"
)
raise
Exc
ep
tion
(
"Unexpected situation happend in elementwise_sub"
)
def
pool2d
(
self
,
op
,
block
):
pool_type
=
{
...
...
@@ -565,7 +567,7 @@ class OpSet9(object):
input_shape
=
block
.
vars
[
op
.
input
(
'X'
)[
0
]].
shape
if
op
.
attr
(
'align_corners'
)
or
op
.
attr
(
'align_mode'
)
==
0
:
raise
Exception
(
"Resize in onnx(opset<=10) only support coordinate_transformation_mode: 'asymmetric', Try converting with --onnx_op
es
t 11"
"Resize in onnx(opset<=10) only support coordinate_transformation_mode: 'asymmetric', Try converting with --onnx_op
se
t 11"
)
if
(
'OutSize'
in
input_names
and
len
(
op
.
input
(
'OutSize'
))
>
0
)
or
(
'SizeTensor'
in
input_names
and
...
...
@@ -763,14 +765,15 @@ class OpSet9(object):
inputs
=
[
op
.
input
(
'X'
)[
0
],
temp_value
],
outputs
=
op
.
output
(
'Out'
))
return
[
shape_node
,
y_node
,
node
]
elif
len
(
x_shape
)
==
len
(
y_shape
):
elif
axis
==
-
1
or
axis
==
(
len
(
x_shape
)
-
1
)
or
len
(
x_shape
)
==
len
(
y_shape
):
node
=
helper
.
make_node
(
'Mul'
,
inputs
=
[
op
.
input
(
'X'
)[
0
],
op
.
input
(
'Y'
)[
0
]],
outputs
=
op
.
output
(
'Out'
))
return
node
else
:
raise
Exc
petion
(
"Unexpected situation happend in elementwise_add
"
)
raise
Exc
eption
(
"Unexpected situation happend in elementwise_mul
"
)
return
node
def
feed
(
self
,
op
,
block
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录