Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
2304e07f
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看板
未验证
提交
2304e07f
编写于
10月 10, 2019
作者:
M
mamingjie-China
提交者:
GitHub
10月 10, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7 from PaddlePaddle/develop
更新数据
上级
98040d71
2bcb8fd3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
36 deletion
+14
-36
x2paddle/op_mapper/caffe_custom_layer/shufflechannel.py
x2paddle/op_mapper/caffe_custom_layer/shufflechannel.py
+1
-7
x2paddle/op_mapper/caffe_op_mapper.py
x2paddle/op_mapper/caffe_op_mapper.py
+13
-29
未找到文件。
x2paddle/op_mapper/caffe_custom_layer/shufflechannel.py
浏览文件 @
2304e07f
...
@@ -8,13 +8,7 @@ def shufflechannel_shape(input_shape):
...
@@ -8,13 +8,7 @@ def shufflechannel_shape(input_shape):
def
shufflechannel_layer
(
inputs
,
group
=
None
,
input_shape
=
None
,
name
=
None
):
def
shufflechannel_layer
(
inputs
,
group
=
None
,
input_shape
=
None
,
name
=
None
):
input
=
inputs
[
0
]
input
=
inputs
[
0
]
c_fm
=
fluid
.
layers
.
split
(
input
,
num_or_sections
=
input_shape
[
0
][
1
],
dim
=
1
)
out
=
fluid
.
layers
.
shuffle_channel
(
x
=
input
,
group
=
group
)
size
=
int
(
input_shape
[
0
][
1
]
/
group
)
new_c_fm
=
[]
for
i
in
range
(
size
):
for
j
in
range
(
group
):
new_c_fm
.
append
(
c_fm
[
j
*
size
+
i
])
out
=
fluid
.
layers
.
concat
(
new_c_fm
,
axis
=
1
)
return
out
return
out
...
...
x2paddle/op_mapper/caffe_op_mapper.py
浏览文件 @
2304e07f
...
@@ -450,35 +450,19 @@ class CaffeOpMapper(OpMapper):
...
@@ -450,35 +450,19 @@ class CaffeOpMapper(OpMapper):
slice_dim
=
params
.
slice_dim
slice_dim
=
params
.
slice_dim
if
slice_dim
!=
1
and
axis
==
1
:
if
slice_dim
!=
1
and
axis
==
1
:
axis
=
slice_dim
axis
=
slice_dim
points
=
list
(
params
.
slice_point
)
output_shape
=
node
.
output_shape
sections_list
=
[]
if
len
(
points
)
==
0
:
for
s
in
output_shape
:
dims
=
node
.
input_shape
[
0
][
axis
]
sections_list
.
append
(
s
[
axis
])
assert
dims
%
top_len
==
0
,
"the parameter of Slice is wrong"
attr
=
{
part
=
dims
/
top_len
'num_or_sections'
:
sections_list
,
t
=
part
'dim'
:
axis
,
while
t
<
dims
:
'name'
:
string
(
node
.
layer_name
)
points
.
append
(
int
(
t
))
}
t
+=
part
node
.
fluid_code
.
add_layer
(
"split"
,
maxint32
=
2147483647
inputs
=
input
,
points
=
[
0
]
+
points
output
=
node
.
layer_name
,
points
.
append
(
maxint32
)
param_attr
=
attr
)
i
=
0
node
.
fluid_code
.
add_note
(
'{} = []'
.
format
(
node
.
layer_name
))
for
i
in
range
(
len
(
points
)):
attr
=
{
'axes'
:
[
axis
],
'starts'
:
[
points
[
i
]],
'ends'
:
[
points
[
i
+
1
]]
}
node
.
fluid_code
.
add_layer
(
"slice"
,
inputs
=
input
,
output
=
node
.
layer_name
+
'_'
+
str
(
i
),
param_attr
=
attr
)
node
.
fluid_code
.
add_note
(
'{}.append({})'
.
format
(
node
.
layer_name
,
node
.
layer_name
+
'_'
+
str
(
i
)))
if
i
==
len
(
points
)
-
2
:
break
def
Concat
(
self
,
node
):
def
Concat
(
self
,
node
):
assert
len
(
assert
len
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录