Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
9466e956
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看板
提交
9466e956
编写于
4月 22, 2019
作者:
T
Tao Luo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reduce unittest time by rename testcuda to has_cuda
test=develop
上级
a770ce06
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
15 addition
and
15 deletion
+15
-15
python/paddle/fluid/tests/unittests/test_conv2d_fusion_op.py
python/paddle/fluid/tests/unittests/test_conv2d_fusion_op.py
+2
-2
python/paddle/fluid/tests/unittests/test_conv3d_op.py
python/paddle/fluid/tests/unittests/test_conv3d_op.py
+5
-5
python/paddle/fluid/tests/unittests/test_lstm_cudnn_op.py
python/paddle/fluid/tests/unittests/test_lstm_cudnn_op.py
+2
-2
python/paddle/fluid/tests/unittests/test_pool2d_op.py
python/paddle/fluid/tests/unittests/test_pool2d_op.py
+3
-3
python/paddle/fluid/tests/unittests/test_pool3d_op.py
python/paddle/fluid/tests/unittests/test_pool3d_op.py
+3
-3
未找到文件。
python/paddle/fluid/tests/unittests/test_conv2d_fusion_op.py
浏览文件 @
9466e956
...
@@ -90,11 +90,11 @@ class TestConv2dFusionOp(OpTest):
...
@@ -90,11 +90,11 @@ class TestConv2dFusionOp(OpTest):
self
.
set_outputs
()
self
.
set_outputs
()
def
test
cuda
(
self
):
def
has_
cuda
(
self
):
return
core
.
is_compiled_with_cuda
()
return
core
.
is_compiled_with_cuda
()
def
test_check_output
(
self
):
def
test_check_output
(
self
):
if
self
.
test
cuda
():
if
self
.
has_
cuda
():
place
=
core
.
CUDAPlace
(
0
)
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
else
:
else
:
...
...
python/paddle/fluid/tests/unittests/test_conv3d_op.py
浏览文件 @
9466e956
...
@@ -108,24 +108,24 @@ class TestConv3dOp(OpTest):
...
@@ -108,24 +108,24 @@ class TestConv3dOp(OpTest):
}
}
self
.
outputs
=
{
'Output'
:
output
}
self
.
outputs
=
{
'Output'
:
output
}
def
test
cudnn
(
self
):
def
has_
cudnn
(
self
):
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
def
test_check_output
(
self
):
def
test_check_output
(
self
):
place
=
core
.
CUDAPlace
(
0
)
if
self
.
test
cudnn
()
else
core
.
CPUPlace
()
place
=
core
.
CUDAPlace
(
0
)
if
self
.
has_
cudnn
()
else
core
.
CPUPlace
()
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
def
test_check_grad
(
self
):
def
test_check_grad
(
self
):
if
self
.
dtype
==
np
.
float16
:
if
self
.
dtype
==
np
.
float16
:
return
return
place
=
core
.
CUDAPlace
(
0
)
if
self
.
test
cudnn
()
else
core
.
CPUPlace
()
place
=
core
.
CUDAPlace
(
0
)
if
self
.
has_
cudnn
()
else
core
.
CPUPlace
()
self
.
check_grad_with_place
(
self
.
check_grad_with_place
(
place
,
{
'Input'
,
'Filter'
},
'Output'
,
max_relative_error
=
0.03
)
place
,
{
'Input'
,
'Filter'
},
'Output'
,
max_relative_error
=
0.03
)
def
test_check_grad_no_filter
(
self
):
def
test_check_grad_no_filter
(
self
):
if
self
.
dtype
==
np
.
float16
:
if
self
.
dtype
==
np
.
float16
:
return
return
place
=
core
.
CUDAPlace
(
0
)
if
self
.
test
cudnn
()
else
core
.
CPUPlace
()
place
=
core
.
CUDAPlace
(
0
)
if
self
.
has_
cudnn
()
else
core
.
CPUPlace
()
self
.
check_grad_with_place
(
self
.
check_grad_with_place
(
place
,
[
'Input'
],
place
,
[
'Input'
],
'Output'
,
'Output'
,
...
@@ -135,7 +135,7 @@ class TestConv3dOp(OpTest):
...
@@ -135,7 +135,7 @@ class TestConv3dOp(OpTest):
def
test_check_grad_no_input
(
self
):
def
test_check_grad_no_input
(
self
):
if
self
.
dtype
==
np
.
float16
:
if
self
.
dtype
==
np
.
float16
:
return
return
place
=
core
.
CUDAPlace
(
0
)
if
self
.
test
cudnn
()
else
core
.
CPUPlace
()
place
=
core
.
CUDAPlace
(
0
)
if
self
.
has_
cudnn
()
else
core
.
CPUPlace
()
self
.
check_grad_with_place
(
self
.
check_grad_with_place
(
place
,
[
'Input'
],
place
,
[
'Input'
],
'Output'
,
'Output'
,
...
...
python/paddle/fluid/tests/unittests/test_lstm_cudnn_op.py
浏览文件 @
9466e956
...
@@ -171,7 +171,7 @@ class TestCUDNNLstmOp(OpTest):
...
@@ -171,7 +171,7 @@ class TestCUDNNLstmOp(OpTest):
}
}
def
test_output_with_place
(
self
):
def
test_output_with_place
(
self
):
if
self
.
test
cuda
():
if
self
.
has_
cuda
():
place
=
core
.
CUDAPlace
(
0
)
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
...
@@ -184,7 +184,7 @@ class TestCUDNNLstmOp(OpTest):
...
@@ -184,7 +184,7 @@ class TestCUDNNLstmOp(OpTest):
[
'Out'
,
'last_h'
,
'last_c'
],
[
'Out'
,
'last_h'
,
'last_c'
],
max_relative_error
=
0.02
)
max_relative_error
=
0.02
)
def
test
cuda
(
self
):
def
has_
cuda
(
self
):
return
core
.
is_compiled_with_cuda
()
return
core
.
is_compiled_with_cuda
()
...
...
python/paddle/fluid/tests/unittests/test_pool2d_op.py
浏览文件 @
9466e956
...
@@ -148,11 +148,11 @@ class TestPool2D_Op(OpTest):
...
@@ -148,11 +148,11 @@ class TestPool2D_Op(OpTest):
self
.
outputs
=
{
'Out'
:
output
}
self
.
outputs
=
{
'Out'
:
output
}
def
test
cudnn
(
self
):
def
has_
cudnn
(
self
):
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
def
test_check_output
(
self
):
def
test_check_output
(
self
):
if
self
.
test
cudnn
():
if
self
.
has_
cudnn
():
place
=
core
.
CUDAPlace
(
0
)
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
else
:
else
:
...
@@ -161,7 +161,7 @@ class TestPool2D_Op(OpTest):
...
@@ -161,7 +161,7 @@ class TestPool2D_Op(OpTest):
def
test_check_grad
(
self
):
def
test_check_grad
(
self
):
if
self
.
dtype
==
np
.
float16
:
if
self
.
dtype
==
np
.
float16
:
return
return
if
self
.
test
cudnn
()
and
self
.
pool_type
!=
"max"
:
if
self
.
has_
cudnn
()
and
self
.
pool_type
!=
"max"
:
place
=
core
.
CUDAPlace
(
0
)
place
=
core
.
CUDAPlace
(
0
)
self
.
check_grad_with_place
(
self
.
check_grad_with_place
(
place
,
set
([
'X'
]),
'Out'
,
max_relative_error
=
0.07
)
place
,
set
([
'X'
]),
'Out'
,
max_relative_error
=
0.07
)
...
...
python/paddle/fluid/tests/unittests/test_pool3d_op.py
浏览文件 @
9466e956
...
@@ -172,11 +172,11 @@ class TestPool3d_Op(OpTest):
...
@@ -172,11 +172,11 @@ class TestPool3d_Op(OpTest):
self
.
outputs
=
{
'Out'
:
output
}
self
.
outputs
=
{
'Out'
:
output
}
def
test
cudnn
(
self
):
def
has_
cudnn
(
self
):
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
def
test_check_output
(
self
):
def
test_check_output
(
self
):
if
self
.
test
cudnn
():
if
self
.
has_
cudnn
():
place
=
core
.
CUDAPlace
(
0
)
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
else
:
else
:
...
@@ -185,7 +185,7 @@ class TestPool3d_Op(OpTest):
...
@@ -185,7 +185,7 @@ class TestPool3d_Op(OpTest):
def
test_check_grad
(
self
):
def
test_check_grad
(
self
):
if
self
.
dtype
==
np
.
float16
:
if
self
.
dtype
==
np
.
float16
:
return
return
if
self
.
test
cudnn
()
and
self
.
pool_type
!=
"max"
:
if
self
.
has_
cudnn
()
and
self
.
pool_type
!=
"max"
:
place
=
core
.
CUDAPlace
(
0
)
place
=
core
.
CUDAPlace
(
0
)
self
.
check_grad_with_place
(
self
.
check_grad_with_place
(
place
,
set
([
'X'
]),
'Out'
,
max_relative_error
=
0.07
)
place
,
set
([
'X'
]),
'Out'
,
max_relative_error
=
0.07
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录