Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
6469514a
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看板
提交
6469514a
编写于
8月 04, 2020
作者:
M
mamingjie-China
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
a9bb2791
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
x2paddle/op_mapper/tf_op_mapper_nhwc.py
x2paddle/op_mapper/tf_op_mapper_nhwc.py
+13
-13
未找到文件。
x2paddle/op_mapper/tf_op_mapper_nhwc.py
浏览文件 @
6469514a
...
...
@@ -197,8 +197,8 @@ class TFOpMapperNHWC(OpMapper):
perm
=
perm
)
def
Fill
(
self
,
node
):
dims
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
input_value
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
]
,
copy
=
True
)
dims
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
input_value
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
])
assert
input_value
.
layer_type
==
"Const"
,
"Value of fill OP should be Const"
input_value
=
input_value
.
value
...
...
@@ -212,7 +212,7 @@ class TFOpMapperNHWC(OpMapper):
value
=
input_value
)
def
DepthToSpace
(
self
,
node
):
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
block_size
=
node
.
get_attr
(
"block_size"
)
data_format
=
node
.
get_attr
(
"data_format"
).
decode
()
...
...
@@ -264,7 +264,7 @@ class TFOpMapperNHWC(OpMapper):
perm
=
[
0
,
2
,
3
,
1
])
def
MaxPool
(
self
,
node
):
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
k_size
=
node
.
get_attr
(
"ksize"
)
strides
=
node
.
get_attr
(
"strides"
)
...
...
@@ -592,7 +592,7 @@ class TFOpMapperNHWC(OpMapper):
perm
=
[
0
,
2
,
3
,
1
])
def
AvgPool
(
self
,
node
):
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
k_size
=
node
.
get_attr
(
"ksize"
)
strides
=
node
.
get_attr
(
"strides"
)
...
...
@@ -904,7 +904,7 @@ class TFOpMapperNHWC(OpMapper):
keep_dim
=
keep_dims
)
def
RandomUniform
(
self
,
node
):
shape
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
shape
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
if
shape
.
layer_type
==
"Const"
:
shape
=
shape
.
value
.
tolist
()
program
.
add_layer
(
...
...
@@ -984,8 +984,8 @@ class TFOpMapperNHWC(OpMapper):
perm
=
[
0
,
2
,
3
,
1
])
def
Tile
(
self
,
node
):
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
expand_times
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
]
,
copy
=
True
)
input
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
expand_times
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
])
inputs
=
{
"x"
:
input
.
name
}
attr
=
dict
()
if
expand_times
.
layer_type
==
"Const"
:
...
...
@@ -1001,9 +1001,9 @@ class TFOpMapperNHWC(OpMapper):
**
attr
)
def
Range
(
self
,
node
):
start
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
limit
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
]
,
copy
=
True
)
delta
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
2
]
,
copy
=
True
)
start
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
limit
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
])
delta
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
2
])
inputs
=
dict
()
attr
=
dict
()
...
...
@@ -1028,8 +1028,8 @@ class TFOpMapperNHWC(OpMapper):
**
attr
)
def
SquaredDifference
(
self
,
node
):
x
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
]
,
copy
=
True
)
y
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
]
,
copy
=
True
)
x
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
0
])
y
=
self
.
graph
.
get_node
(
node
.
layer
.
input
[
1
])
inputs
=
{
"x"
:
x
.
name
,
"y"
:
y
.
name
}
program
.
add_layer
(
"fluid.layers.elementwise_sub"
,
inputs
=
inputs
,
outputs
=
[
node
.
name
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录