Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
41a7ce83
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
41a7ce83
编写于
9月 25, 2020
作者:
L
Leo Chen
提交者:
GitHub
9月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix random failure of test_buffer_sahred_memory_reuse_pass (#27551)
上级
a2e0b7cb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
3 deletion
+11
-3
python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py
...d/tests/unittests/test_buffer_shared_memory_reuse_pass.py
+11
-3
未找到文件。
python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py
浏览文件 @
41a7ce83
...
@@ -115,8 +115,15 @@ class InplaceTestBase(unittest.TestCase):
...
@@ -115,8 +115,15 @@ class InplaceTestBase(unittest.TestCase):
fetch_val2
,
=
exe
.
run
(
compiled_prog
,
fetch_val2
,
=
exe
.
run
(
compiled_prog
,
feed
=
feed_dict
,
feed
=
feed_dict
,
fetch_list
=
[
fetch_var
])
fetch_list
=
[
fetch_var
])
#NOTE(zhiqiu): Temporally changed from array_equal to allclose.
self
.
assertTrue
(
np
.
array_equal
(
fetch_val1
,
fetch_val2
))
# The real root is fuse_all_reduce and fuse_all_optimizer_opss may
# result in diff because of the instruction set on the virtual machine.
# And the related unit tests: test_fuse_all_reduce_pass and test_fuse_optimizer_pass use "almostEqual" in their checks.
# There are also some related issues:
# https://github.com/PaddlePaddle/Paddle/issues/21270
# https://github.com/PaddlePaddle/Paddle/issues/21046
# https://github.com/PaddlePaddle/Paddle/issues/21045
self
.
assertTrue
(
np
.
allclose
(
fetch_val1
,
fetch_val2
))
def
check_multi_card_fetch_var
(
self
):
def
check_multi_card_fetch_var
(
self
):
if
self
.
is_invalid_test
():
if
self
.
is_invalid_test
():
...
@@ -160,7 +167,8 @@ class InplaceTestBase(unittest.TestCase):
...
@@ -160,7 +167,8 @@ class InplaceTestBase(unittest.TestCase):
fetch_vals
.
append
(
fetch_val
)
fetch_vals
.
append
(
fetch_val
)
for
item
in
fetch_vals
:
for
item
in
fetch_vals
:
self
.
assertTrue
(
np
.
array_equal
(
fetch_vals
[
0
],
item
))
# save above
self
.
assertTrue
(
np
.
allclose
(
fetch_vals
[
0
],
item
))
class
CUDAInplaceTest
(
InplaceTestBase
):
class
CUDAInplaceTest
(
InplaceTestBase
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录