Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
23d489c3
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看板
提交
23d489c3
编写于
7月 20, 2020
作者:
C
Channingss
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug & optimize code struct
上级
5b6614fa
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
9 addition
and
7 deletion
+9
-7
x2paddle/op_mapper/onnx2paddle/onnx_op_mapper.py
x2paddle/op_mapper/onnx2paddle/onnx_op_mapper.py
+1
-2
x2paddle/op_mapper/onnx2paddle/opset9/__init__.py
x2paddle/op_mapper/onnx2paddle/opset9/__init__.py
+2
-0
x2paddle/op_mapper/onnx2paddle/opset9/custom_layer/__init__.py
...dle/op_mapper/onnx2paddle/opset9/custom_layer/__init__.py
+0
-0
x2paddle/op_mapper/onnx2paddle/opset9/custom_layer/register.py
...dle/op_mapper/onnx2paddle/opset9/custom_layer/register.py
+0
-0
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
+6
-5
x2paddle/op_mapper/onnx2paddle/opsets/__init__.py
x2paddle/op_mapper/onnx2paddle/opsets/__init__.py
+0
-0
未找到文件。
x2paddle/op_mapper/onnx2paddle/onnx_op_mapper.py
浏览文件 @
23d489c3
...
@@ -12,9 +12,8 @@
...
@@ -12,9 +12,8 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
from
x2paddle.op_mapper.onnx2paddle.opset
s.opset9
import
OpSet9
from
x2paddle.op_mapper.onnx2paddle.opset
9
import
OpSet9
,
custom_layers
from
x2paddle.core.op_mapper
import
OpMapper
from
x2paddle.core.op_mapper
import
OpMapper
from
x2paddle.op_mapper.onnx_opsets.custom_layer
import
*
from
x2paddle.decoder.onnx_decoder
import
ONNXGraph
,
ONNXGraphNode
,
ONNXGraphDataNode
from
x2paddle.decoder.onnx_decoder
import
ONNXGraph
,
ONNXGraphNode
,
ONNXGraphDataNode
...
...
x2paddle/op_mapper/onnx2paddle/opset9/__init__.py
0 → 100644
浏览文件 @
23d489c3
from
.opset
import
OpSet9
from
.custom_layer
import
custom_layers
x2paddle/op_mapper/onnx2paddle/opset
s
/custom_layer/__init__.py
→
x2paddle/op_mapper/onnx2paddle/opset
9
/custom_layer/__init__.py
浏览文件 @
23d489c3
文件已移动
x2paddle/op_mapper/onnx2paddle/opset
s
/custom_layer/register.py
→
x2paddle/op_mapper/onnx2paddle/opset
9
/custom_layer/register.py
浏览文件 @
23d489c3
文件已移动
x2paddle/op_mapper/onnx2paddle/opset
s/opset9
.py
→
x2paddle/op_mapper/onnx2paddle/opset
9/opset
.py
浏览文件 @
23d489c3
...
@@ -17,6 +17,7 @@ from x2paddle.core.graph import GraphNode
...
@@ -17,6 +17,7 @@ from x2paddle.core.graph import GraphNode
from
x2paddle.core.fluid_code
import
Layer
from
x2paddle.core.fluid_code
import
Layer
from
x2paddle.core.fluid_code
import
FluidCode
from
x2paddle.core.fluid_code
import
FluidCode
from
x2paddle.core.util
import
string
from
x2paddle.core.util
import
string
from
x2paddle.op_mapper.onnx2paddle.opset9.custom_layer
import
*
from
functools
import
reduce
from
functools
import
reduce
import
numpy
as
np
import
numpy
as
np
import
onnx
import
onnx
...
@@ -1379,8 +1380,8 @@ class OpSet9():
...
@@ -1379,8 +1380,8 @@ class OpSet9():
node
,
idx
=
5
-
miss_arg_num
,
copy
=
True
)
node
,
idx
=
5
-
miss_arg_num
,
copy
=
True
)
x_shape
=
val_x
.
out_shapes
[
0
]
x_shape
=
val_x
.
out_shapes
[
0
]
print
(
x_shape
)
assert
x_shape
[
1
]
==
1
,
'only X with batch_size = 1 supported'
#
assert x_shape[1] == 1, 'only X with batch_size = 1 supported'
assert
node
.
get_attr
(
'clip'
,
None
)
is
None
,
'clipping not supported'
assert
node
.
get_attr
(
'clip'
,
None
)
is
None
,
'clipping not supported'
hidden_size
=
node
.
get_attr
(
'hidden_size'
,
None
)
hidden_size
=
node
.
get_attr
(
'hidden_size'
,
None
)
...
@@ -1467,8 +1468,8 @@ class OpSet9():
...
@@ -1467,8 +1468,8 @@ class OpSet9():
inputs
=
val_b
,
inputs
=
val_b
,
output
=
var_bi
+
','
+
var_bh
,
output
=
var_bi
+
','
+
var_bh
,
param_attr
=
{
param_attr
=
{
'
axis
'
:
1
,
'
dim
'
:
1
,
'
split
'
:
[
hidden_size
*
3
,
hidden_size
*
3
],
'
num_or_sections
'
:
[
hidden_size
*
3
,
hidden_size
*
3
],
'name'
:
string
(
node
.
layer_name
+
'.b/split'
)
'name'
:
string
(
node
.
layer_name
+
'.b/split'
)
})
})
var_bi0
=
node
.
layer_name
+
'_bi0'
var_bi0
=
node
.
layer_name
+
'_bi0'
...
@@ -1480,7 +1481,7 @@ class OpSet9():
...
@@ -1480,7 +1481,7 @@ class OpSet9():
'name'
:
string
(
var_bi0
)})
'name'
:
string
(
var_bi0
)})
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
'elmentwise_add'
,
'el
e
mentwise_add'
,
inputs
=
[
var_mm
,
var_bi0
],
inputs
=
[
var_mm
,
var_bi0
],
output
=
var_fc
,
output
=
var_fc
,
param_attr
=
{
param_attr
=
{
...
...
x2paddle/op_mapper/onnx2paddle/opsets/__init__.py
已删除
100644 → 0
浏览文件 @
5b6614fa
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录