Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
1f0ef42e
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1f0ef42e
编写于
2月 21, 2019
作者:
M
minqiyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change atol of numpy allclose
上级
f53e1d5c
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
4 addition
and
9 deletion
+4
-9
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+1
-1
python/paddle/fluid/tests/unittests/test_imperative_optimizer.py
...paddle/fluid/tests/unittests/test_imperative_optimizer.py
+3
-8
未找到文件。
python/paddle/fluid/framework.py
浏览文件 @
1f0ef42e
...
@@ -1195,7 +1195,7 @@ class Block(object):
...
@@ -1195,7 +1195,7 @@ class Block(object):
if
not
var
.
persistable
:
if
not
var
.
persistable
:
del
self
.
vars
[
name
]
del
self
.
vars
[
name
]
self
.
ops
.
clear
()
del
self
.
ops
[:]
def
all_parameters
(
self
):
def
all_parameters
(
self
):
return
list
(
self
.
iter_parameters
())
return
list
(
self
.
iter_parameters
())
...
...
python/paddle/fluid/tests/unittests/test_imperative_optimizer.py
浏览文件 @
1f0ef42e
...
@@ -114,11 +114,7 @@ class TestImperativeMnist(unittest.TestCase):
...
@@ -114,11 +114,7 @@ class TestImperativeMnist(unittest.TestCase):
dy_param_init_value
=
{}
dy_param_init_value
=
{}
for
epoch
in
range
(
epoch_num
):
for
epoch
in
range
(
epoch_num
):
print
(
"epoch"
,
epoch
)
for
batch_id
,
data
in
enumerate
(
train_reader
()):
for
batch_id
,
data
in
enumerate
(
train_reader
()):
# if batch_id >= batch_num:
# break
dy_x_data
=
np
.
array
(
dy_x_data
=
np
.
array
(
[
x
[
0
].
reshape
(
1
,
28
,
28
)
[
x
[
0
].
reshape
(
1
,
28
,
28
)
for
x
in
data
]).
astype
(
'float32'
)
for
x
in
data
]).
astype
(
'float32'
)
...
@@ -186,9 +182,6 @@ class TestImperativeMnist(unittest.TestCase):
...
@@ -186,9 +182,6 @@ class TestImperativeMnist(unittest.TestCase):
for
epoch
in
range
(
epoch_num
):
for
epoch
in
range
(
epoch_num
):
for
batch_id
,
data
in
enumerate
(
train_reader
()):
for
batch_id
,
data
in
enumerate
(
train_reader
()):
# if batch_id >= batch_num:
# break
static_x_data
=
np
.
array
(
static_x_data
=
np
.
array
(
[
x
[
0
].
reshape
(
1
,
28
,
28
)
[
x
[
0
].
reshape
(
1
,
28
,
28
)
for
x
in
data
]).
astype
(
'float32'
)
for
x
in
data
]).
astype
(
'float32'
)
...
@@ -209,13 +202,15 @@ class TestImperativeMnist(unittest.TestCase):
...
@@ -209,13 +202,15 @@ class TestImperativeMnist(unittest.TestCase):
static_param_value
[
static_param_name_list
[
i
-
1
]]
=
out
[
static_param_value
[
static_param_name_list
[
i
-
1
]]
=
out
[
i
]
i
]
self
.
assertTrue
(
np
.
allclose
(
dy_x_data
.
all
(),
static_x_data
.
all
()))
for
key
,
value
in
six
.
iteritems
(
static_param_init_value
):
for
key
,
value
in
six
.
iteritems
(
static_param_init_value
):
self
.
assertTrue
(
np
.
allclose
(
value
,
dy_param_init_value
[
key
]))
self
.
assertTrue
(
np
.
allclose
(
value
,
dy_param_init_value
[
key
]))
self
.
assertTrue
(
np
.
allclose
(
static_out
,
dy_out
))
self
.
assertTrue
(
np
.
allclose
(
static_out
,
dy_out
))
for
key
,
value
in
six
.
iteritems
(
static_param_value
):
for
key
,
value
in
six
.
iteritems
(
static_param_value
):
self
.
assertTrue
(
np
.
allclose
(
value
,
dy_param_value
[
key
]))
self
.
assertTrue
(
np
.
allclose
(
value
,
dy_param_value
[
key
]
,
atol
=
1e-6
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录