Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
044d671e
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
044d671e
编写于
11月 17, 2017
作者:
F
fengjiayi
提交者:
GitHub
11月 17, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename 'argu' in framework.py to 'arg' (#5723)
上级
56f28a0f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
20 deletion
+25
-20
python/paddle/v2/fluid/framework.py
python/paddle/v2/fluid/framework.py
+25
-20
未找到文件。
python/paddle/v2/fluid/framework.py
浏览文件 @
044d671e
...
...
@@ -4,7 +4,10 @@ import collections
import
numpy
as
np
import
copy
__all__
=
[
'Block'
,
'Variable'
,
'Program'
,
'Operator'
,
'default_startup_program'
,
'default_main_program'
]
__all__
=
[
'Block'
,
'Variable'
,
'Program'
,
'Operator'
,
'default_startup_program'
,
'default_main_program'
]
def
unique_name
(
prefix
):
...
...
@@ -232,17 +235,17 @@ class Operator(object):
in_proto
.
name
)
if
found
:
in_arg
u
s
=
inputs
[
in_proto
.
name
]
if
not
isinstance
(
in_arg
u
s
,
list
):
in_arg
us
=
[
in_argu
s
]
if
not
in_proto
.
duplicable
and
len
(
in_arg
u
s
)
>
1
:
in_args
=
inputs
[
in_proto
.
name
]
if
not
isinstance
(
in_args
,
list
):
in_arg
s
=
[
in_arg
s
]
if
not
in_proto
.
duplicable
and
len
(
in_args
)
>
1
:
raise
ValueError
(
"Input %s expects only one input, but %d are given."
%
(
in_proto
.
name
,
len
(
in_arg
u
s
)))
in_arg
u
_names
=
[]
for
arg
u
in
in_argu
s
:
in_arg
u_names
.
append
(
argu
.
name
)
self
.
desc
.
set_input
(
in_proto
.
name
,
in_arg
u
_names
)
%
(
in_proto
.
name
,
len
(
in_args
)))
in_arg_names
=
[]
for
arg
in
in_arg
s
:
in_arg
_names
.
append
(
arg
.
name
)
self
.
desc
.
set_input
(
in_proto
.
name
,
in_arg_names
)
else
:
self
.
desc
.
set_input
(
in_proto
.
name
,
[])
...
...
@@ -260,18 +263,18 @@ class Operator(object):
str
(
e
)
for
e
in
given
)))
for
out_proto
in
proto
.
outputs
:
out_arg
u
s
=
outputs
[
out_proto
.
name
]
if
not
isinstance
(
out_arg
u
s
,
list
):
out_arg
us
=
[
out_argu
s
]
if
not
out_proto
.
duplicable
and
len
(
out_arg
u
s
)
>
1
:
out_args
=
outputs
[
out_proto
.
name
]
if
not
isinstance
(
out_args
,
list
):
out_arg
s
=
[
out_arg
s
]
if
not
out_proto
.
duplicable
and
len
(
out_args
)
>
1
:
raise
ValueError
(
"Output %s expects only one output, but %d are given."
%
(
out_proto
.
name
,
len
(
out_arg
u
s
)))
out_arg
u
_names
=
[]
for
arg
u
in
out_argu
s
:
out_arg
u_names
.
append
(
argu
.
name
)
arg
u
.
op
=
self
self
.
desc
.
set_output
(
out_proto
.
name
,
out_arg
u
_names
)
(
out_proto
.
name
,
len
(
out_args
)))
out_arg_names
=
[]
for
arg
in
out_arg
s
:
out_arg
_names
.
append
(
arg
.
name
)
arg
.
op
=
self
self
.
desc
.
set_output
(
out_proto
.
name
,
out_arg_names
)
if
attrs
is
not
None
:
if
not
isinstance
(
attrs
,
dict
):
...
...
@@ -582,8 +585,10 @@ class Parameter(Variable):
g_main_program
=
Program
()
g_startup_program
=
Program
()
def
default_startup_program
():
return
g_startup_program
def
default_main_program
():
return
g_main_program
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录