Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
b3a11943
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
b3a11943
编写于
4月 23, 2019
作者:
T
Tao Luo
提交者:
GitHub
4月 23, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17031 from luotao1/reduce_test_time
reduce unittest time by rename testcuda to has_cuda
上级
c1c2633a
9466e956
变更
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
浏览文件 @
b3a11943
...
...
@@ -90,11 +90,11 @@ class TestConv2dFusionOp(OpTest):
self
.
set_outputs
()
def
test
cuda
(
self
):
def
has_
cuda
(
self
):
return
core
.
is_compiled_with_cuda
()
def
test_check_output
(
self
):
if
self
.
test
cuda
():
if
self
.
has_
cuda
():
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
else
:
...
...
python/paddle/fluid/tests/unittests/test_conv3d_op.py
浏览文件 @
b3a11943
...
...
@@ -108,24 +108,24 @@ class TestConv3dOp(OpTest):
}
self
.
outputs
=
{
'Output'
:
output
}
def
test
cudnn
(
self
):
def
has_
cudnn
(
self
):
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
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
)
def
test_check_grad
(
self
):
if
self
.
dtype
==
np
.
float16
:
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
(
place
,
{
'Input'
,
'Filter'
},
'Output'
,
max_relative_error
=
0.03
)
def
test_check_grad_no_filter
(
self
):
if
self
.
dtype
==
np
.
float16
:
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
(
place
,
[
'Input'
],
'Output'
,
...
...
@@ -135,7 +135,7 @@ class TestConv3dOp(OpTest):
def
test_check_grad_no_input
(
self
):
if
self
.
dtype
==
np
.
float16
:
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
(
place
,
[
'Input'
],
'Output'
,
...
...
python/paddle/fluid/tests/unittests/test_lstm_cudnn_op.py
浏览文件 @
b3a11943
...
...
@@ -171,7 +171,7 @@ class TestCUDNNLstmOp(OpTest):
}
def
test_output_with_place
(
self
):
if
self
.
test
cuda
():
if
self
.
has_
cuda
():
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
...
...
@@ -184,7 +184,7 @@ class TestCUDNNLstmOp(OpTest):
[
'Out'
,
'last_h'
,
'last_c'
],
max_relative_error
=
0.02
)
def
test
cuda
(
self
):
def
has_
cuda
(
self
):
return
core
.
is_compiled_with_cuda
()
...
...
python/paddle/fluid/tests/unittests/test_pool2d_op.py
浏览文件 @
b3a11943
...
...
@@ -148,11 +148,11 @@ class TestPool2D_Op(OpTest):
self
.
outputs
=
{
'Out'
:
output
}
def
test
cudnn
(
self
):
def
has_
cudnn
(
self
):
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
def
test_check_output
(
self
):
if
self
.
test
cudnn
():
if
self
.
has_
cudnn
():
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
else
:
...
...
@@ -161,7 +161,7 @@ class TestPool2D_Op(OpTest):
def
test_check_grad
(
self
):
if
self
.
dtype
==
np
.
float16
:
return
if
self
.
test
cudnn
()
and
self
.
pool_type
!=
"max"
:
if
self
.
has_
cudnn
()
and
self
.
pool_type
!=
"max"
:
place
=
core
.
CUDAPlace
(
0
)
self
.
check_grad_with_place
(
place
,
set
([
'X'
]),
'Out'
,
max_relative_error
=
0.07
)
...
...
python/paddle/fluid/tests/unittests/test_pool3d_op.py
浏览文件 @
b3a11943
...
...
@@ -172,11 +172,11 @@ class TestPool3d_Op(OpTest):
self
.
outputs
=
{
'Out'
:
output
}
def
test
cudnn
(
self
):
def
has_
cudnn
(
self
):
return
core
.
is_compiled_with_cuda
()
and
self
.
use_cudnn
def
test_check_output
(
self
):
if
self
.
test
cudnn
():
if
self
.
has_
cudnn
():
place
=
core
.
CUDAPlace
(
0
)
self
.
check_output_with_place
(
place
,
atol
=
1e-5
)
else
:
...
...
@@ -185,7 +185,7 @@ class TestPool3d_Op(OpTest):
def
test_check_grad
(
self
):
if
self
.
dtype
==
np
.
float16
:
return
if
self
.
test
cudnn
()
and
self
.
pool_type
!=
"max"
:
if
self
.
has_
cudnn
()
and
self
.
pool_type
!=
"max"
:
place
=
core
.
CUDAPlace
(
0
)
self
.
check_grad_with_place
(
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录