Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
868dd694
提交
868dd694
authored
3月 04, 2015
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some pep8
上级
e4533cec
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
12 行删除
+10
-12
test_dnn.py
theano/sandbox/cuda/tests/test_dnn.py
+10
-12
没有找到文件。
theano/sandbox/cuda/tests/test_dnn.py
浏览文件 @
868dd694
import
logging
import
unittest
from
nose.plugins.skip
import
SkipTest
import
numpy
...
...
@@ -10,11 +9,10 @@ from theano.compat.six import StringIO
from
theano.gof.python25
import
any
import
theano.tensor
as
T
import
theano.tests.unittest_tools
as
utt
from
theano.sandbox.neighbours
import
images2neibs
,
neibs2images
from
theano.sandbox.neighbours
import
images2neibs
from
theano.tensor.signal.downsample
import
max_pool_2d
from
theano.tensor.signal.downsample
import
DownsampleFactorMaxGrad
import
theano.sandbox.cuda.dnn
as
dnn
from
theano.sandbox.cuda.basic_ops
import
gpu_contiguous
# Skip test if cuda_ndarray is not available.
import
theano.sandbox.cuda
as
cuda
...
...
@@ -70,8 +68,8 @@ def test_pooling():
raise
SkipTest
(
cuda
.
dnn
.
dnn_available
.
msg
)
x
=
T
.
ftensor4
()
for
func
,
pad
in
product
(
(
T
.
max
,
T
.
mean
),
((
0
,
0
),
(
1
,
0
),
(
1
,
0
),
(
2
,
3
),
(
3
,
2
))):
for
func
,
pad
in
product
(
(
T
.
max
,
T
.
mean
),
((
0
,
0
),
(
1
,
0
),
(
1
,
0
),
(
2
,
3
),
(
3
,
2
))):
if
pad
!=
(
0
,
0
)
and
cuda
.
dnn
.
version
()
<
20
:
continue
...
...
@@ -104,7 +102,7 @@ def test_pooling():
for
shp
in
[(
1
,
10
,
100
,
100
),
(
1
,
3
,
99
,
99
),
(
32
,
1
,
147
,
197
),
]:
]:
print
func
,
pad
,
ws
,
stride
,
shp
data
=
numpy
.
random
.
normal
(
0
,
1
,
shp
)
.
astype
(
"float32"
)
...
...
@@ -193,7 +191,7 @@ def test_pooling_opt():
def
test_dnn_tag
():
"""
We t
est that if cudnn isn't avail we crash and that if it is avail, we use it.
T
est that if cudnn isn't avail we crash and that if it is avail, we use it.
"""
x
=
T
.
ftensor4
()
old
=
theano
.
config
.
on_opt_error
...
...
@@ -440,11 +438,11 @@ class TestDnnInferShapes(utt.InferShapeTester):
mode
=
params
[
2
]
)()
pool_grad
=
dnn
.
GpuDnnPoolGrad
()(
img
,
out
,
img_grad
,
desc
)
img
,
out
,
img_grad
,
desc
)
self
.
_compile_and_check
(
[
img
,
img_grad
,
out
],
[
pool_grad
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论