Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
fa449c88
P
Paddle
项目概览
机器未来
/
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看板
未验证
提交
fa449c88
编写于
2月 26, 2020
作者:
T
tianshuo78520a
提交者:
GitHub
2月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix typo word (#22761)
上级
66991218
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
16 deletion
+16
-16
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+16
-16
未找到文件。
python/paddle/fluid/framework.py
浏览文件 @
fa449c88
...
@@ -458,7 +458,7 @@ def name_scope(prefix=None):
...
@@ -458,7 +458,7 @@ def name_scope(prefix=None):
if
in_dygraph_mode
():
if
in_dygraph_mode
():
yield
yield
else
:
else
:
assert
prefix
,
"namescope prefix canot be empty."
assert
prefix
,
"namescope prefix can
n
ot be empty."
global
_name_scope
global
_name_scope
_name_scope
=
_name_scope
.
child
(
prefix
)
_name_scope
=
_name_scope
.
child
(
prefix
)
yield
yield
...
@@ -1495,7 +1495,7 @@ class Variable(object):
...
@@ -1495,7 +1495,7 @@ class Variable(object):
if
length
<
0
:
if
length
<
0
:
raise
ValueError
(
"length should not be negative"
)
raise
ValueError
(
"length should not be negative"
)
if
step
==
0
:
if
step
==
0
:
raise
ValueError
(
"slice step canot be zero"
)
raise
ValueError
(
"slice step can
n
ot be zero"
)
# Find lower and upper bounds for start and stop.
# Find lower and upper bounds for start and stop.
lower
=
-
1
if
step
<
0
else
0
lower
=
-
1
if
step
<
0
else
0
...
@@ -2965,7 +2965,7 @@ class IrVarNode(IrNode):
...
@@ -2965,7 +2965,7 @@ class IrVarNode(IrNode):
shape(list): shape to be set.
shape(list): shape to be set.
"""
"""
assert
self
.
node
.
var
()
is
not
None
,
\
assert
self
.
node
.
var
()
is
not
None
,
\
"The node variable description canot be None."
"The node variable description can
n
ot be None."
self
.
node
.
var
().
set_shape
(
shape
)
self
.
node
.
var
().
set_shape
(
shape
)
def
persistable
(
self
):
def
persistable
(
self
):
...
@@ -2976,7 +2976,7 @@ class IrVarNode(IrNode):
...
@@ -2976,7 +2976,7 @@ class IrVarNode(IrNode):
bool: indicate whether the variable is persistable.
bool: indicate whether the variable is persistable.
"""
"""
assert
self
.
node
.
var
()
is
not
None
,
\
assert
self
.
node
.
var
()
is
not
None
,
\
"The node variable description canot be None."
"The node variable description can
n
ot be None."
return
self
.
node
.
var
().
persistable
()
return
self
.
node
.
var
().
persistable
()
def
type
(
self
):
def
type
(
self
):
...
@@ -2987,7 +2987,7 @@ class IrVarNode(IrNode):
...
@@ -2987,7 +2987,7 @@ class IrVarNode(IrNode):
core.VarDesc.VarType: the variable type.
core.VarDesc.VarType: the variable type.
"""
"""
assert
self
.
node
.
var
()
is
not
None
,
\
assert
self
.
node
.
var
()
is
not
None
,
\
"The node variable description canot be None."
"The node variable description can
n
ot be None."
return
self
.
node
.
var
().
type
()
return
self
.
node
.
var
().
type
()
def
dtype
(
self
):
def
dtype
(
self
):
...
@@ -2998,7 +2998,7 @@ class IrVarNode(IrNode):
...
@@ -2998,7 +2998,7 @@ class IrVarNode(IrNode):
core.VarDesc.VarType: the variable data type.
core.VarDesc.VarType: the variable data type.
"""
"""
assert
self
.
node
.
var
()
is
not
None
,
\
assert
self
.
node
.
var
()
is
not
None
,
\
"The node variable description canot be None."
"The node variable description can
n
ot be None."
return
self
.
node
.
var
().
dtype
()
return
self
.
node
.
var
().
dtype
()
def
shape
(
self
):
def
shape
(
self
):
...
@@ -3009,7 +3009,7 @@ class IrVarNode(IrNode):
...
@@ -3009,7 +3009,7 @@ class IrVarNode(IrNode):
list: the variable shape.
list: the variable shape.
"""
"""
assert
self
.
node
.
var
()
is
not
None
,
\
assert
self
.
node
.
var
()
is
not
None
,
\
"The node variable description canot be None."
"The node variable description can
n
ot be None."
return
self
.
node
.
var
().
shape
()
return
self
.
node
.
var
().
shape
()
@
property
@
property
...
@@ -3059,7 +3059,7 @@ class IrOpNode(IrNode):
...
@@ -3059,7 +3059,7 @@ class IrOpNode(IrNode):
new_input_name(str): the new input name.
new_input_name(str): the new input name.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
self
.
node
.
op
().
_rename_input
(
old_input_name
,
new_input_name
)
self
.
node
.
op
().
_rename_input
(
old_input_name
,
new_input_name
)
def
rename_output
(
self
,
old_output_name
,
new_output_name
):
def
rename_output
(
self
,
old_output_name
,
new_output_name
):
...
@@ -3071,7 +3071,7 @@ class IrOpNode(IrNode):
...
@@ -3071,7 +3071,7 @@ class IrOpNode(IrNode):
new_output_name(str): the new output name.
new_output_name(str): the new output name.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
print
(
"op: {}, old: {}, new: {}
\n
"
.
format
(
self
.
node
.
op
().
type
(
print
(
"op: {}, old: {}, new: {}
\n
"
.
format
(
self
.
node
.
op
().
type
(
),
old_output_name
,
new_output_name
))
),
old_output_name
,
new_output_name
))
self
.
node
.
op
().
_rename_output
(
old_output_name
,
new_output_name
)
self
.
node
.
op
().
_rename_output
(
old_output_name
,
new_output_name
)
...
@@ -3087,7 +3087,7 @@ class IrOpNode(IrNode):
...
@@ -3087,7 +3087,7 @@ class IrOpNode(IrNode):
list(str): the argument name list.
list(str): the argument name list.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
return
self
.
node
.
op
().
input
(
name
)
return
self
.
node
.
op
().
input
(
name
)
def
output
(
self
,
name
):
def
output
(
self
,
name
):
...
@@ -3101,7 +3101,7 @@ class IrOpNode(IrNode):
...
@@ -3101,7 +3101,7 @@ class IrOpNode(IrNode):
list(str): the argument name list.
list(str): the argument name list.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
return
self
.
node
.
op
().
output
(
name
)
return
self
.
node
.
op
().
output
(
name
)
def
set_type
(
self
,
new_type
):
def
set_type
(
self
,
new_type
):
...
@@ -3112,7 +3112,7 @@ class IrOpNode(IrNode):
...
@@ -3112,7 +3112,7 @@ class IrOpNode(IrNode):
new_type(str): new operator type to be set.
new_type(str): new operator type to be set.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
return
self
.
node
.
op
().
set_type
(
new_type
)
return
self
.
node
.
op
().
set_type
(
new_type
)
def
set_attr
(
self
,
name
,
val
):
def
set_attr
(
self
,
name
,
val
):
...
@@ -3130,7 +3130,7 @@ class IrOpNode(IrNode):
...
@@ -3130,7 +3130,7 @@ class IrOpNode(IrNode):
Update the value of the op desc's attribute by attribute's name.
Update the value of the op desc's attribute by attribute's name.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
desc
=
self
.
node
.
op
()
desc
=
self
.
node
.
op
()
if
isinstance
(
val
,
Block
):
if
isinstance
(
val
,
Block
):
desc
.
set_block_attr
(
name
,
val
.
desc
)
desc
.
set_block_attr
(
name
,
val
.
desc
)
...
@@ -3151,7 +3151,7 @@ class IrOpNode(IrNode):
...
@@ -3151,7 +3151,7 @@ class IrOpNode(IrNode):
list(str): input arguments' names of this op node.
list(str): input arguments' names of this op node.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
return
self
.
node
.
op
().
input_arg_names
()
return
self
.
node
.
op
().
input_arg_names
()
def
output_arg_names
(
self
):
def
output_arg_names
(
self
):
...
@@ -3162,7 +3162,7 @@ class IrOpNode(IrNode):
...
@@ -3162,7 +3162,7 @@ class IrOpNode(IrNode):
list(str): output arguments' names of this op node.
list(str): output arguments' names of this op node.
"""
"""
assert
self
.
node
.
op
()
is
not
None
,
\
assert
self
.
node
.
op
()
is
not
None
,
\
"The node operator description canot be None."
"The node operator description can
n
ot be None."
return
self
.
node
.
op
().
output_arg_names
()
return
self
.
node
.
op
().
output_arg_names
()
@
property
@
property
...
@@ -3459,7 +3459,7 @@ class IrGraph(object):
...
@@ -3459,7 +3459,7 @@ class IrGraph(object):
"""
"""
Perform the topology sort operation on the graph.
Perform the topology sort operation on the graph.
Notes: the `graph` canot contain a circle.
Notes: the `graph` can
n
ot contain a circle.
Returns:
Returns:
list(IrNode): nodes in topology order.
list(IrNode): nodes in topology order.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录