Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0fa0aa36
提交
0fa0aa36
authored
6月 20, 2017
作者:
Seton Steven Bocco
提交者:
notoraptor
6月 27, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update tests to make them more precise.
上级
9123a835
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
17 行删除
+16
-17
test_dnn.py
theano/gpuarray/tests/test_dnn.py
+16
-17
没有找到文件。
theano/gpuarray/tests/test_dnn.py
浏览文件 @
0fa0aa36
...
@@ -1067,7 +1067,7 @@ def get_conv3d_test_cases():
...
@@ -1067,7 +1067,7 @@ def get_conv3d_test_cases():
return
itt
return
itt
def
run_conv_batched_vs_multicall
(
inputs_shape
,
filters_shape
,
batch_sub
,
subsample
):
def
run_conv_
small_
batched_vs_multicall
(
inputs_shape
,
filters_shape
,
batch_sub
,
subsample
):
# Run function for issue $5985 (see tests below): https://github.com/Theano/Theano/issues/5985
# Run function for issue $5985 (see tests below): https://github.com/Theano/Theano/issues/5985
# We use GPU RNG to help create big arrays on GPU directly and then avoid transfer.
# We use GPU RNG to help create big arrays on GPU directly and then avoid transfer.
...
@@ -1087,7 +1087,7 @@ def run_conv_batched_vs_multicall(inputs_shape, filters_shape, batch_sub, subsam
...
@@ -1087,7 +1087,7 @@ def run_conv_batched_vs_multicall(inputs_shape, filters_shape, batch_sub, subsam
inputs_size
=
4.0
# sizeof(float32)
inputs_size
=
4.0
# sizeof(float32)
for
i
in
inputs_shape
:
for
i
in
inputs_shape
:
inputs_size
*=
i
inputs_size
*=
i
print
(
'
Input size:'
,
(
inputs_size
/
1024
/
1024
/
1024
),
'Gb
'
)
print
(
'
(input size'
,
(
inputs_size
/
1024
/
1024
/
1024
),
'Gb)'
,
end
=
'
'
)
conv
=
dnn
.
dnn_conv
(
img
=
inputs
,
kerns
=
filters
,
algo
=
algo
,
subsample
=
subsample
)
conv
=
dnn
.
dnn_conv
(
img
=
inputs
,
kerns
=
filters
,
algo
=
algo
,
subsample
=
subsample
)
# Just compute last inputs to reduce execution time.
# Just compute last inputs to reduce execution time.
...
@@ -1095,25 +1095,24 @@ def run_conv_batched_vs_multicall(inputs_shape, filters_shape, batch_sub, subsam
...
@@ -1095,25 +1095,24 @@ def run_conv_batched_vs_multicall(inputs_shape, filters_shape, batch_sub, subsam
batched_outputs
=
[
dnn
.
dnn_conv
(
img
=
inputs
[
i
:(
i
+
1
)],
kerns
=
filters
,
algo
=
algo
,
subsample
=
subsample
)
batched_outputs
=
[
dnn
.
dnn_conv
(
img
=
inputs
[
i
:(
i
+
1
)],
kerns
=
filters
,
algo
=
algo
,
subsample
=
subsample
)
for
i
in
range
(
size
-
batch_sub
,
size
)]
for
i
in
range
(
size
-
batch_sub
,
size
)]
f
=
theano
.
function
([],
[
conv
]
+
batched_outputs
,
mode
=
mode_with_gpu
)
f
=
theano
.
function
([],
[
conv
]
+
batched_outputs
,
mode
=
mode_with_gpu
)
print
(
'Computing'
)
outputs
=
f
()
outputs
=
f
()
res_all
=
outputs
[
0
]
res_all
=
outputs
[
0
]
res_batch
=
outputs
[
1
:]
res_batch
=
outputs
[
1
:]
print
(
"Output shapes:"
,
res_all
.
shape
,
res_batch
[
0
]
.
shape
)
for
i
in
range
(
batch_sub
):
for
i
in
range
(
batch_sub
):
utt
.
assert_allclose
(
res_batch
[
i
],
res_all
[
size
-
batch_sub
+
i
],
atol
=
1e-6
,
rtol
=
1e-6
)
utt
.
assert_allclose
(
res_batch
[
i
],
res_all
[
size
-
batch_sub
+
i
])
def
test_batched_conv_success
():
def
test_batched_conv_small
():
# With 10 000 inputs. Should pass (tested on GeForce GTX TITAN X, cuDNN 6020).
# Tested on TITAN X:
# Subsample is set to (3, 3) to reduce output size.
# pass up to 65536 inputs (inputs size exactly 1Gb), fail with 65536 + 1 inputs and upper.
yield
(
run_conv_batched_vs_multicall
,
(
10000
,
4
,
32
,
32
),
(
1
,
4
,
16
,
16
),
25
,
(
3
,
3
))
# Is there any limitation around number of elements, or input size ?
# But all dimensions and strides for following tensors are under int32 limits.
# Maybe the problem is with the internal pointer used by cuDNN to iterate over input
def
test_batched_conv_fail
():
# (could this pointer not be able to manage more than 1 Gb?).
# With 70 000 inputs (vs 10 000 above). Should fail (tested on GeForce GTX TITAN X, cuDNN 6020).
# NB: Subsample is set to (3, 3) to reduce output size.
# Subsample is set to (3, 3) to reduce output size (useful when error is printed).
yield
(
run_conv_small_batched_vs_multicall
,
(
65535
,
4
,
32
,
32
),
(
1
,
4
,
16
,
16
),
25
,
(
3
,
3
))
# OK
yield
(
run_conv_batched_vs_multicall
,
(
70000
,
4
,
32
,
32
),
(
1
,
4
,
16
,
16
),
25
,
(
3
,
3
))
yield
(
run_conv_small_batched_vs_multicall
,
(
65536
,
4
,
32
,
32
),
(
1
,
4
,
16
,
16
),
25
,
(
3
,
3
))
# OK
yield
(
run_conv_small_batched_vs_multicall
,
(
65537
,
4
,
32
,
32
),
(
1
,
4
,
16
,
16
),
25
,
(
3
,
3
))
# ERROR
def
test_conv3d_fwd
():
def
test_conv3d_fwd
():
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论