Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
97df7f87
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看板
提交
97df7f87
编写于
9月 29, 2020
作者:
J
jiangjiajun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix for keras bert
上级
13d5bda8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
3 deletion
+14
-3
x2paddle/decoder/tf_decoder.py
x2paddle/decoder/tf_decoder.py
+1
-1
x2paddle/op_mapper/tf_op_mapper.py
x2paddle/op_mapper/tf_op_mapper.py
+10
-2
x2paddle/optimizer/tensorflow/batch_norm.py
x2paddle/optimizer/tensorflow/batch_norm.py
+1
-0
x2paddle/optimizer/tensorflow/bias.py
x2paddle/optimizer/tensorflow/bias.py
+1
-0
x2paddle/optimizer/tensorflow/transpose.py
x2paddle/optimizer/tensorflow/transpose.py
+1
-0
未找到文件。
x2paddle/decoder/tf_decoder.py
浏览文件 @
97df7f87
...
...
@@ -60,7 +60,7 @@ class TFGraphNode(GraphNode):
@
property
def
dtype
(
self
):
keys
=
[
'dtype'
,
'T
idx'
,
'T
'
,
'DstT'
]
keys
=
[
'dtype'
,
'T'
,
'DstT'
]
for
k
in
keys
:
dtype
=
self
.
layer
.
attr
[
k
].
type
if
dtype
>
0
:
...
...
x2paddle/op_mapper/tf_op_mapper.py
浏览文件 @
97df7f87
...
...
@@ -744,7 +744,7 @@ class TFOpMapper(OpMapper):
input_names
=
[
i
.
name
for
i
in
inputs
]
for
i
,
ipt
in
enumerate
(
inputs
):
if
node
.
dtype
==
'bool'
:
if
ipt
.
dtype
==
'bool'
:
cast_name
=
gen_name
(
'concat'
,
'cast'
)
program
.
add_layer
(
kernel
=
"fluid.layers.cast"
,
...
...
@@ -1213,9 +1213,17 @@ class TFOpMapper(OpMapper):
attr
[
"dim"
]
=
reduce_idx
.
value
.
tolist
()
attr
[
"keep_dim"
]
=
node
.
get_attr
(
"keep_dims"
)
input_name
=
input
.
name
if
input
.
dtype
!=
"bool"
:
input_name
=
gen_name
(
"all"
,
"cast"
)
program
.
add_layer
(
"fluid.layers.cast"
,
inputs
=
{
"x"
:
input
.
name
},
outputs
=
[
input_name
],
dtype
=
string
(
"bool"
))
program
.
add_layer
(
"fluid.layers.reduce_all"
,
inputs
=
{
"input"
:
input
.
name
},
inputs
=
{
"input"
:
input
_
name
},
outputs
=
[
node
.
name
],
**
attr
)
...
...
x2paddle/optimizer/tensorflow/batch_norm.py
浏览文件 @
97df7f87
...
...
@@ -8,6 +8,7 @@ class BatchNormOpt:
pass
def
run
(
self
,
graph
):
print
(
"Optimize: BatchNormOpt..."
)
layers
=
copy
.
deepcopy
(
graph
.
layers
)
for
layer_id
,
layer
in
layers
.
items
():
if
layer
.
kernel
!=
"fluid.layers.elementwise_add"
:
...
...
x2paddle/optimizer/tensorflow/bias.py
浏览文件 @
97df7f87
...
...
@@ -13,6 +13,7 @@ class BiasOpt:
]
def
run
(
self
,
graph
):
print
(
"Optimize: BiasOpt..."
)
layers
=
copy
.
deepcopy
(
graph
.
layers
)
for
layer_id
,
layer
in
layers
.
items
():
if
layer
.
kernel
in
self
.
conv_layers
or
layer
.
kernel
==
"fluid.layers.transpose"
:
...
...
x2paddle/optimizer/tensorflow/transpose.py
浏览文件 @
97df7f87
...
...
@@ -36,6 +36,7 @@ class TransposeOpt:
return
count
def
run
(
self
,
graph
):
print
(
"Optimize: TransposeOpt..."
)
total_layer_num
=
len
(
graph
.
layers
)
scanned_layers
=
set
()
optimized_transpose_layers
=
list
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录