Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a95e719a
提交
a95e719a
authored
5月 16, 2017
作者:
Gabe Schwartz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make sure we always check dnn.version() before using dilated convs.
上级
b2f47d62
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
17 行增加
和
7 行删除
+17
-7
test_dnn.py
theano/gpuarray/tests/test_dnn.py
+17
-7
没有找到文件。
theano/gpuarray/tests/test_dnn.py
浏览文件 @
a95e719a
...
@@ -640,8 +640,10 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -640,8 +640,10 @@ class TestDnnInferShapes(utt.InferShapeTester):
testcase_func_name
=
utt
.
custom_name_func
)
testcase_func_name
=
utt
.
custom_name_func
)
def
test_conv
(
self
,
algo
,
border_mode
,
conv_mode
):
def
test_conv
(
self
,
algo
,
border_mode
,
conv_mode
):
# Currently only CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM (algo 'none')
# Currently only CUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM (algo 'none')
# supports dilation > 1.
# supports dilation > 1. 'time*' and 'guess*' should fallback to it.
dilations
=
[(
1
,
1
),
(
2
,
2
)]
if
(
algo
==
"none"
and
dnn
.
version
()
>=
6000
)
else
[(
1
,
1
)]
dilations
=
[(
1
,
1
)]
if
dnn
.
version
()
>=
6000
and
(
algo
==
"none"
or
"time_"
in
algo
or
"guess_"
in
algo
):
dilations
+=
[(
2
,
2
)]
self
.
_test_conv
(
T
.
tensor4
(
'img'
),
self
.
_test_conv
(
T
.
tensor4
(
'img'
),
T
.
tensor4
(
'kerns'
),
T
.
tensor4
(
'kerns'
),
...
@@ -656,6 +658,8 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -656,6 +658,8 @@ class TestDnnInferShapes(utt.InferShapeTester):
@parameterized.expand
(
product
(
border_modes
,
conv_modes
),
utt
.
custom_name_func
)
@parameterized.expand
(
product
(
border_modes
,
conv_modes
),
utt
.
custom_name_func
)
def
test_conv3d_none
(
self
,
border_mode
,
conv_mode
):
def
test_conv3d_none
(
self
,
border_mode
,
conv_mode
):
dilations
=
[(
1
,
1
,
1
),
(
2
,
2
,
2
)]
if
dnn
.
version
()
>=
6000
else
[(
1
,
1
,
1
)]
self
.
_test_conv
(
T
.
tensor5
(
'img'
),
self
.
_test_conv
(
T
.
tensor5
(
'img'
),
T
.
tensor5
(
'kerns'
),
T
.
tensor5
(
'kerns'
),
T
.
tensor5
(
'out'
),
T
.
tensor5
(
'out'
),
...
@@ -664,7 +668,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -664,7 +668,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
border_mode
,
border_mode
,
conv_mode
,
conv_mode
,
[(
1
,
1
,
1
),
(
2
,
2
,
2
)],
[(
1
,
1
,
1
),
(
2
,
2
,
2
)],
[(
1
,
1
,
1
),
(
2
,
2
,
2
)]
,
dilations
,
'none'
)
'none'
)
def
_test_conv_gradw
(
self
,
img
,
topgrad
,
kerns
,
img_shape
,
kerns_shape
,
border_mode
,
conv_mode
,
subsamples
,
dilations
):
def
_test_conv_gradw
(
self
,
img
,
topgrad
,
kerns
,
img_shape
,
kerns_shape
,
border_mode
,
conv_mode
,
subsamples
,
dilations
):
...
@@ -711,6 +715,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -711,6 +715,7 @@ class TestDnnInferShapes(utt.InferShapeTester):
@parameterized.expand
(
product
(
border_modes
,
conv_modes
),
utt
.
custom_name_func
)
@parameterized.expand
(
product
(
border_modes
,
conv_modes
),
utt
.
custom_name_func
)
def
test_conv_gradw
(
self
,
border_mode
,
conv_mode
):
def
test_conv_gradw
(
self
,
border_mode
,
conv_mode
):
dilations
=
[(
1
,
1
),
(
2
,
2
)]
if
dnn
.
version
()
>=
6000
else
[(
1
,
1
)]
dilations
=
[(
1
,
1
),
(
2
,
2
)]
if
dnn
.
version
()
>=
6000
else
[(
1
,
1
)]
self
.
_test_conv_gradw
(
T
.
tensor4
(
'img'
),
self
.
_test_conv_gradw
(
T
.
tensor4
(
'img'
),
T
.
tensor4
(
'topgrad'
),
T
.
tensor4
(
'topgrad'
),
T
.
tensor4
(
'kerns'
),
T
.
tensor4
(
'kerns'
),
...
@@ -1023,8 +1028,6 @@ def get_conv3d_test_cases():
...
@@ -1023,8 +1028,6 @@ def get_conv3d_test_cases():
[(
8
,
4
,
20
,
12
,
15
),
(
5
,
4
,
6
,
12
,
4
),
(
2
,
2
,
2
),
(
1
,
1
,
1
)],
[(
8
,
4
,
20
,
12
,
15
),
(
5
,
4
,
6
,
12
,
4
),
(
2
,
2
,
2
),
(
1
,
1
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
3
,
3
),
(
1
,
1
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
3
,
3
),
(
1
,
1
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
2
,
1
),
(
1
,
1
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
12
,
4
),
(
3
,
2
,
1
),
(
1
,
1
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
3
,
4
),
(
1
,
1
,
2
),
(
3
,
2
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
3
,
4
),
(
2
,
2
,
1
),
(
1
,
2
,
3
)],
# Test with 1x1x1 filters
# Test with 1x1x1 filters
[(
8
,
1
,
10
,
10
,
10
),
(
10
,
1
,
1
,
1
,
1
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
[(
8
,
1
,
10
,
10
,
10
),
(
10
,
1
,
1
,
1
,
1
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
# Test with dimensions larger than 1024 (thread block dim)
# Test with dimensions larger than 1024 (thread block dim)
...
@@ -1042,8 +1045,15 @@ def get_conv3d_test_cases():
...
@@ -1042,8 +1045,15 @@ def get_conv3d_test_cases():
test_shapes_full
=
[[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
3
,
1
,
1
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
test_shapes_full
=
[[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
3
,
1
,
1
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
1
,
3
,
1
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
1
,
3
,
1
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
1
,
1
,
3
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
1
,
1
,
3
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
5
,
5
,
5
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)],
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
5
,
5
,
5
),
(
1
,
1
,
1
),
(
1
,
1
,
1
)]]
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
5
,
5
,
5
),
(
1
,
1
,
1
),
(
3
,
2
,
1
)]]
if
dnn
.
version
()
>=
6000
:
test_shapes
.
extend
([
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
3
,
4
),
(
1
,
1
,
2
),
(
3
,
2
,
1
)],
[(
8
,
1
,
20
,
12
,
15
),
(
5
,
1
,
6
,
3
,
4
),
(
2
,
2
,
1
),
(
1
,
2
,
3
)]])
test_shapes_full
.
append
(
[(
6
,
2
,
2
,
2
,
2
),
(
4
,
2
,
5
,
5
,
5
),
(
1
,
1
,
1
),
(
3
,
2
,
1
)])
border_modes
=
[
'valid'
,
'full'
,
'half'
,
(
1
,
2
,
3
),
(
3
,
2
,
1
),
1
,
2
]
border_modes
=
[
'valid'
,
'full'
,
'half'
,
(
1
,
2
,
3
),
(
3
,
2
,
1
),
1
,
2
]
conv_modes
=
[
'conv'
,
'cross'
]
conv_modes
=
[
'conv'
,
'cross'
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论