Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
bc5d32fe
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看板
提交
bc5d32fe
编写于
8月 10, 2020
作者:
C
Channingss
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug
上级
36f461ee
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
5 deletion
+13
-5
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
+13
-5
未找到文件。
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
浏览文件 @
bc5d32fe
...
@@ -672,7 +672,7 @@ class OpSet9():
...
@@ -672,7 +672,7 @@ class OpSet9():
perm
=
list
(
range
(
len
(
val_x
.
out_shapes
[
0
])))
perm
=
list
(
range
(
len
(
val_x
.
out_shapes
[
0
])))
perm
=
[
axis
]
+
perm
[:
axis
]
+
perm
[
axis
+
1
:]
perm
=
[
axis
]
+
perm
[:
axis
]
+
perm
[
axis
+
1
:]
attr_trans
=
{
'perm'
:
perm
}
attr_trans
=
{
'perm'
:
perm
}
name_trans
=
val_x
.
layer_name
+
'_trans'
name_trans
=
val_x
.
layer_name
+
'_trans
pose
'
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
'transpose'
,
'transpose'
,
inputs
=
val_x
,
inputs
=
val_x
,
...
@@ -684,8 +684,12 @@ class OpSet9():
...
@@ -684,8 +684,12 @@ class OpSet9():
'index'
:
indices_reshape
},
'index'
:
indices_reshape
},
output
=
node
,
output
=
node
,
param_attr
=
None
)
param_attr
=
None
)
input_transpose
=
node
.
layer_name
+
'_transpose'
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
'transpose'
,
inputs
=
node
,
output
=
node
,
param_attr
=
attr_trans
)
'transpose'
,
inputs
=
node
,
output
=
input_transpose
,
param_attr
=
attr_trans
)
val_x_shape
=
val_x
.
out_shapes
[
0
]
val_x_shape
=
val_x
.
out_shapes
[
0
]
reshaped_shape
=
[]
reshaped_shape
=
[]
for
i
in
perm
:
for
i
in
perm
:
...
@@ -694,7 +698,7 @@ class OpSet9():
...
@@ -694,7 +698,7 @@ class OpSet9():
reshaped_shape
.
append
(
i
)
reshaped_shape
.
append
(
i
)
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
'reshape'
,
'reshape'
,
inputs
=
nod
e
,
inputs
=
input_transpos
e
,
output
=
node
,
output
=
node
,
param_attr
=
{
'shape'
:
reshaped_shape
})
param_attr
=
{
'shape'
:
reshaped_shape
})
...
@@ -748,17 +752,21 @@ class OpSet9():
...
@@ -748,17 +752,21 @@ class OpSet9():
}
}
else
:
else
:
if
starts
.
dtype
!=
'int32'
:
if
starts
.
dtype
!=
'int32'
:
starts_cast
=
starts
.
layer_name
+
'_cast'
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
'cast'
,
'cast'
,
inputs
=
starts
,
inputs
=
starts
,
output
=
starts
,
output
=
starts
_cast
,
param_attr
=
{
'dtype'
:
string
(
'int32'
)})
param_attr
=
{
'dtype'
:
string
(
'int32'
)})
attr
[
'starts'
]
=
starts_cast
if
ends
.
dtype
!=
'int32'
:
if
ends
.
dtype
!=
'int32'
:
ends_cast
=
ens
.
layer_name
+
'_cast'
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
'cast'
,
'cast'
,
inputs
=
ends
,
inputs
=
ends
,
output
=
ends
,
output
=
ends
_cast
,
param_attr
=
{
'dtype'
:
string
(
'int32'
)})
param_attr
=
{
'dtype'
:
string
(
'int32'
)})
attr
[
'ends'
]
=
ends_cast
else
:
else
:
starts
=
node
.
get_attr
(
'starts'
)
starts
=
node
.
get_attr
(
'starts'
)
ends
=
node
.
get_attr
(
'ends'
)
ends
=
node
.
get_attr
(
'ends'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录