Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzpei9
Paddle
提交
01eddf12
P
Paddle
项目概览
wzpei9
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
01eddf12
编写于
3月 07, 2019
作者:
Z
Zhen Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Not add graph copy construction method. test=develop
上级
1b9c8d5f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
9 deletion
+8
-9
paddle/fluid/framework/ir/graph.cc
paddle/fluid/framework/ir/graph.cc
+0
-3
paddle/fluid/framework/ir/graph.h
paddle/fluid/framework/ir/graph.h
+0
-1
paddle/fluid/pybind/ir.cc
paddle/fluid/pybind/ir.cc
+4
-4
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+4
-1
未找到文件。
paddle/fluid/framework/ir/graph.cc
浏览文件 @
01eddf12
...
...
@@ -14,7 +14,6 @@ limitations under the License. */
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include "paddle/fluid/framework/ir/graph.h"
#include "paddle/fluid/framework/op_proto_maker.h"
...
...
@@ -30,8 +29,6 @@ Graph::Graph(const ProgramDesc &program) : program_(program) {
ResolveHazard
(
var_nodes
);
}
Graph
::
Graph
(
const
Graph
&
o
)
:
Graph
(
o
.
program_
)
{}
std
::
map
<
std
::
string
,
std
::
vector
<
ir
::
Node
*>>
Graph
::
InitFromProgram
(
const
ProgramDesc
&
program
)
{
VLOG
(
3
)
<<
"block in program:"
<<
program_
.
Size
();
...
...
paddle/fluid/framework/ir/graph.h
浏览文件 @
01eddf12
...
...
@@ -72,7 +72,6 @@ namespace ir {
class
Graph
{
public:
explicit
Graph
(
const
ProgramDesc
&
program
);
Graph
(
const
Graph
&
o
);
virtual
~
Graph
()
{
for
(
auto
&
attr
:
attrs_
)
{
...
...
paddle/fluid/pybind/ir.cc
浏览文件 @
01eddf12
...
...
@@ -54,14 +54,13 @@ void BindGraph(py::module *m) {
"The graph is a Directed Acyclic Single Static Assignment Graph, see "
"`paddle::ir::Graph` for details."
)
.
def
(
py
::
init
<
const
ProgramDesc
&>
())
.
def
(
"__init__"
,
[](
Graph
&
self
,
const
Graph
&
other
)
{
new
(
&
self
)
Graph
(
other
);
})
.
def
(
"has"
,
&
Graph
::
Has
)
.
def
(
"get_int"
,
&
Graph
::
Get
<
int
>
)
.
def
(
"get_float"
,
&
Graph
::
Get
<
float
>
)
.
def
(
"get_double"
,
&
Graph
::
Get
<
double
>
)
.
def
(
"get_string"
,
&
Graph
::
Get
<
std
::
string
>
)
.
def
(
"get_marked_nodes"
,
&
Graph
::
Get
<
std
::
unordered_set
<
const
Node
*>>
)
.
def
(
"get_marked_nodes"
,
&
Graph
::
Get
<
std
::
unordered_set
<
const
Node
*>>
,
return_value_policy
::
reference
)
.
def
(
"set"
,
[](
Graph
&
self
,
const
std
::
string
&
attr_name
,
int
attr
)
{
return
self
.
Set
(
attr_name
,
new
int
(
attr
));
})
.
def
(
"set"
,
...
...
@@ -105,7 +104,8 @@ void BindGraph(py::module *m) {
.
def
(
"retrieve_node"
,
&
Graph
::
RetrieveNode
,
return_value_policy
::
reference
)
.
def
(
"resolve_hazard"
,
&
Graph
::
ResolveHazard
)
.
def
(
"origin_program_desc"
,
&
Graph
::
OriginProgram
);
.
def
(
"origin_program_desc"
,
&
Graph
::
OriginProgram
,
return_value_policy
::
reference
);
}
void
BindNode
(
py
::
module
*
m
)
{
...
...
python/paddle/fluid/framework.py
浏览文件 @
01eddf12
...
...
@@ -2006,10 +2006,13 @@ class IrGraph(object):
"""
Create a new and duplicated IrGraph.
Warns:
The method only clones the graph structure, not its attributes.
Returns:
IrGraph: A new and duplicated graph.
"""
g
=
core
.
Graph
(
self
.
graph
)
g
=
core
.
Graph
(
self
.
graph
.
origin_program_desc
()
)
return
IrGraph
(
g
,
self
.
_for_test
)
def
is_test
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录