Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
a270ae04
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看板
提交
a270ae04
编写于
8月 05, 2019
作者:
J
jiangjiajun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify
上级
685a0f3b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
7 addition
and
8 deletion
+7
-8
x2paddle/core/graph.py
x2paddle/core/graph.py
+6
-6
x2paddle/core/op_mapper.py
x2paddle/core/op_mapper.py
+1
-1
x2paddle/core/util.py
x2paddle/core/util.py
+0
-1
未找到文件。
x2paddle/core/graph.py
浏览文件 @
a270ae04
...
@@ -43,23 +43,23 @@ class Graph(object):
...
@@ -43,23 +43,23 @@ class Graph(object):
self
.
model
=
model
self
.
model
=
model
def
build
(
self
):
def
build
(
self
):
self
.
_make
_input_nodes
()
self
.
get
_input_nodes
()
self
.
_make
_output_nodes
()
self
.
get
_output_nodes
()
self
.
_
get_topo_sort
()
self
.
get_topo_sort
()
def
_make
_input_nodes
(
self
):
def
get
_input_nodes
(
self
):
for
name
,
node
in
self
.
node_map
.
items
():
for
name
,
node
in
self
.
node_map
.
items
():
name
=
name
.
replace
(
'/'
,
'_'
).
replace
(
'-'
,
'_'
)
name
=
name
.
replace
(
'/'
,
'_'
).
replace
(
'-'
,
'_'
)
if
len
(
node
.
inputs
)
==
0
:
if
len
(
node
.
inputs
)
==
0
:
self
.
input_nodes
.
append
(
name
)
self
.
input_nodes
.
append
(
name
)
def
_make
_output_nodes
(
self
):
def
get
_output_nodes
(
self
):
for
name
,
node
in
self
.
node_map
.
items
():
for
name
,
node
in
self
.
node_map
.
items
():
name
=
name
.
replace
(
'/'
,
'_'
).
replace
(
'-'
,
'_'
)
name
=
name
.
replace
(
'/'
,
'_'
).
replace
(
'-'
,
'_'
)
if
len
(
node
.
outputs
)
==
0
:
if
len
(
node
.
outputs
)
==
0
:
self
.
output_nodes
.
append
(
name
)
self
.
output_nodes
.
append
(
name
)
def
_
get_topo_sort
(
self
):
def
get_topo_sort
(
self
):
num_inputs
=
dict
()
num_inputs
=
dict
()
for
name
,
node
in
self
.
node_map
.
items
():
for
name
,
node
in
self
.
node_map
.
items
():
num_inputs
[
name
]
=
len
(
node
.
inputs
)
num_inputs
[
name
]
=
len
(
node
.
inputs
)
...
...
x2paddle/core/op_mapper.py
浏览文件 @
a270ae04
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# 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
paddle.fluid.proto
import
framework_pb2
from
x2paddle.core.util
import
*
from
x2paddle.core.util
import
*
import
inspect
import
inspect
import
os
import
os
...
...
x2paddle/core/util.py
浏览文件 @
a270ae04
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
# 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
paddle.fluid.proto
import
framework_pb2
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
numpy
import
numpy
import
math
import
math
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录