Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
b3df1f4a
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b3df1f4a
编写于
10月 14, 2017
作者:
D
Dong Zhihong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
"fix tests"
上级
2434b8f5
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
7 addition
and
7 deletion
+7
-7
paddle/pybind/protobuf.cc
paddle/pybind/protobuf.cc
+2
-2
python/paddle/v2/framework/framework.py
python/paddle/v2/framework/framework.py
+1
-1
python/paddle/v2/framework/tests/test_dynamic_recurrent_op.py
...on/paddle/v2/framework/tests/test_dynamic_recurrent_op.py
+3
-3
python/paddle/v2/framework/tests/test_protobuf_descs.py
python/paddle/v2/framework/tests/test_protobuf_descs.py
+1
-1
未找到文件。
paddle/pybind/protobuf.cc
浏览文件 @
b3df1f4a
...
@@ -151,10 +151,10 @@ void BindBlockDesc(py::module &m) {
...
@@ -151,10 +151,10 @@ void BindBlockDesc(py::module &m) {
return
self
.
Var
(
name
);
return
self
.
Var
(
name
);
},
},
py
::
return_value_policy
::
reference
)
py
::
return_value_policy
::
reference
)
.
def
(
"var"
,
.
def
(
"
find_
var"
,
[](
BlockDescBind
&
self
,
py
::
bytes
byte_name
)
{
[](
BlockDescBind
&
self
,
py
::
bytes
byte_name
)
{
std
::
string
name
=
byte_name
;
std
::
string
name
=
byte_name
;
return
self
.
Var
(
name
);
return
self
.
Find
Var
(
name
);
},
},
py
::
return_value_policy
::
reference
)
py
::
return_value_policy
::
reference
)
.
def
(
"all_vars"
,
&
BlockDescBind
::
AllVars
,
.
def
(
"all_vars"
,
&
BlockDescBind
::
AllVars
,
...
...
python/paddle/v2/framework/framework.py
浏览文件 @
b3df1f4a
...
@@ -21,7 +21,7 @@ class Variable(object):
...
@@ -21,7 +21,7 @@ class Variable(object):
if
name
is
None
:
if
name
is
None
:
name
=
Variable
.
_unique_var_name_
()
name
=
Variable
.
_unique_var_name_
()
try
:
try
:
self
.
desc
=
self
.
block
.
desc
.
var
(
name
)
self
.
desc
=
self
.
block
.
desc
.
find_
var
(
name
)
is_new_var
=
False
is_new_var
=
False
except
core
.
EnforceNotMet
:
except
core
.
EnforceNotMet
:
self
.
desc
=
self
.
block
.
desc
.
var
(
name
)
self
.
desc
=
self
.
block
.
desc
.
var
(
name
)
...
...
python/paddle/v2/framework/tests/test_dynamic_recurrent_op.py
浏览文件 @
b3df1f4a
...
@@ -6,7 +6,7 @@ import numpy as np
...
@@ -6,7 +6,7 @@ import numpy as np
def
create_tensor
(
scope
,
name
,
shape
,
np_data
):
def
create_tensor
(
scope
,
name
,
shape
,
np_data
):
tensor
=
scope
.
new_
var
(
name
).
get_tensor
()
tensor
=
scope
.
var
(
name
).
get_tensor
()
tensor
.
set_dims
(
shape
)
tensor
.
set_dims
(
shape
)
tensor
.
set
(
np_data
,
core
.
CPUPlace
())
tensor
.
set
(
np_data
,
core
.
CPUPlace
())
return
tensor
return
tensor
...
@@ -72,8 +72,8 @@ class DynamicRecurrentOpTest(unittest.TestCase):
...
@@ -72,8 +72,8 @@ class DynamicRecurrentOpTest(unittest.TestCase):
create_tensor
(
self
.
scope
,
"U"
,
[
self
.
input_dim
,
self
.
input_dim
],
U
)
create_tensor
(
self
.
scope
,
"U"
,
[
self
.
input_dim
,
self
.
input_dim
],
U
)
create_tensor
(
self
.
scope
,
"h_boot"
,
[
self
.
num_sents
,
self
.
input_dim
],
create_tensor
(
self
.
scope
,
"h_boot"
,
[
self
.
num_sents
,
self
.
input_dim
],
h_boot
)
h_boot
)
self
.
scope
.
new_
var
(
"step_scopes"
)
self
.
scope
.
var
(
"step_scopes"
)
self
.
scope
.
new_
var
(
"h@mem"
)
self
.
scope
.
var
(
"h@mem"
)
def
create_rnn_op
(
self
):
def
create_rnn_op
(
self
):
# create RNNOp
# create RNNOp
...
...
python/paddle/v2/framework/tests/test_protobuf_descs.py
浏览文件 @
b3df1f4a
...
@@ -122,7 +122,7 @@ class TestBlockDesc(unittest.TestCase):
...
@@ -122,7 +122,7 @@ class TestBlockDesc(unittest.TestCase):
var3
=
block
.
var
(
"var3"
)
var3
=
block
.
var
(
"var3"
)
all_vars
=
block
.
all_vars
()
all_vars
=
block
.
all_vars
()
self
.
assertEqual
(
set
(
all_vars
),
set
([
var1
,
var2
,
var3
]))
self
.
assertEqual
(
set
(
all_vars
),
set
([
var1
,
var2
,
var3
]))
var2_re
=
block
.
var
(
"var2"
)
var2_re
=
block
.
find_
var
(
"var2"
)
self
.
assertEqual
(
var2_re
,
var2
)
self
.
assertEqual
(
var2_re
,
var2
)
def
test_add_op
(
self
):
def
test_add_op
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录