Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
720355c3
提交
720355c3
authored
3月 23, 2016
作者:
Harm de Vries
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix other tests
上级
51928399
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
20 行删除
+12
-20
dnn.py
theano/sandbox/gpuarray/dnn.py
+7
-7
test_dnn.py
theano/sandbox/gpuarray/tests/test_dnn.py
+5
-13
没有找到文件。
theano/sandbox/gpuarray/dnn.py
浏览文件 @
720355c3
...
@@ -40,9 +40,9 @@ def raise_no_cudnn(msg="CuDNN is required for convolution and pooling"):
...
@@ -40,9 +40,9 @@ def raise_no_cudnn(msg="CuDNN is required for convolution and pooling"):
def
_dnn_check_compile
():
def
_dnn_check_compile
():
preambule
=
"""
preambule
=
"""
#
include <stdio.h>
#include <stdio.h>
#
include <cudnn.h>
#include <cudnn.h>
#
include <cudnn_helper.h>
#include <cudnn_helper.h>
"""
"""
# No need for the context in here since we won't execute that code
# No need for the context in here since we won't execute that code
...
@@ -201,9 +201,9 @@ class DnnVersion(Op):
...
@@ -201,9 +201,9 @@ class DnnVersion(Op):
def
c_support_code
(
self
):
def
c_support_code
(
self
):
return
"""
return
"""
#
if PY_MAJOR_VERSION >= 3
#if PY_MAJOR_VERSION >= 3
#
define PyInt_FromLong PyLong_FromLong
#define PyInt_FromLong PyLong_FromLong
#
endif
#endif
"""
"""
def
make_node
(
self
):
def
make_node
(
self
):
...
@@ -1090,7 +1090,7 @@ class GpuDnnPool(DnnBase):
...
@@ -1090,7 +1090,7 @@ class GpuDnnPool(DnnBase):
return
[(
'MODE_FLAG'
,
mode_flag
)]
return
[(
'MODE_FLAG'
,
mode_flag
)]
def
make_node
(
self
,
img
,
ws
,
stride
,
pad
):
def
make_node
(
self
,
img
,
ws
,
stride
,
pad
):
ctx_name
=
infer_context_name
(
img
,
ws
,
stride
,
pad
)
ctx_name
=
infer_context_name
(
img
)
img
=
as_gpuarray_variable
(
img
,
ctx_name
)
img
=
as_gpuarray_variable
(
img
,
ctx_name
)
ws
=
tensor
.
as_tensor_variable
(
ws
)
ws
=
tensor
.
as_tensor_variable
(
ws
)
...
...
theano/sandbox/gpuarray/tests/test_dnn.py
浏览文件 @
720355c3
...
@@ -574,14 +574,9 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -574,14 +574,9 @@ class TestDnnInferShapes(utt.InferShapeTester):
[(
1
,
1
),
(
2
,
2
),
(
3
,
3
)],
[(
1
,
1
),
(
2
,
2
),
(
3
,
3
)],
modes
modes
):
):
desc
=
dnn
.
GpuDnnPoolDesc
(
ws
=
params
[
0
],
stride
=
params
[
1
],
mode
=
params
[
2
]
)()
self
.
_compile_and_check
(
self
.
_compile_and_check
(
[
img
],
[
img
],
[
dnn
.
GpuDnnPool
(
)(
img
,
desc
)],
[
dnn
.
GpuDnnPool
(
mode
=
params
[
2
])(
img
,
params
[
0
],
params
[
1
],
(
0
,
0
)
)],
[
img_val
],
[
img_val
],
dnn
.
GpuDnnPool
dnn
.
GpuDnnPool
)
)
...
@@ -610,16 +605,13 @@ class TestDnnInferShapes(utt.InferShapeTester):
...
@@ -610,16 +605,13 @@ class TestDnnInferShapes(utt.InferShapeTester):
[(
1
,
1
),
(
2
,
2
),
(
3
,
3
)],
[(
1
,
1
),
(
2
,
2
),
(
3
,
3
)],
[
'max'
,
'average_inc_pad'
]
[
'max'
,
'average_inc_pad'
]
):
):
desc
=
dnn
.
GpuDnnPoolDesc
(
pool_grad
=
dnn
.
GpuDnnPoolGrad
(
mode
=
params
[
2
])(
ws
=
params
[
0
],
stride
=
params
[
1
],
mode
=
params
[
2
]
)()
pool_grad
=
dnn
.
GpuDnnPoolGrad
()(
img
,
img
,
out
,
out
,
img_grad
,
img_grad
,
desc
params
[
0
],
params
[
1
],
(
0
,
0
)
)
)
self
.
_compile_and_check
(
self
.
_compile_and_check
(
[
img
,
img_grad
,
out
],
[
img
,
img_grad
,
out
],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论