Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3cc0686e
提交
3cc0686e
authored
9月 20, 2016
作者:
Gijs van Tulder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add comments to pooling opts.
上级
a16e91f7
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
7 行增加
和
0 行删除
+7
-0
dnn.py
theano/gpuarray/dnn.py
+4
-0
dnn.py
theano/sandbox/cuda/dnn.py
+3
-0
没有找到文件。
theano/gpuarray/dnn.py
浏览文件 @
3cc0686e
...
...
@@ -1877,6 +1877,7 @@ def local_gpua_pool_dnn_alternative(op, ctx_name, inputs, outputs):
return
img
=
gpu_contiguous
(
as_gpuarray_variable
(
img
,
ctx_name
))
mode
=
op
.
mode
# dnn_pool expects exactly 2 non-pooling dimensions
if
img
.
ndim
==
nd
+
2
:
return
dnn_pool
(
img
,
ws
,
stride
=
stride
,
pad
=
pad
,
mode
=
mode
)
else
:
...
...
@@ -1903,6 +1904,7 @@ def local_gpua_pool_dnn_grad_stride(op, ctx_name, inputs, outputs):
out_grad
=
gpu_contiguous
(
as_gpuarray_variable
(
out_grad
,
ctx_name
))
mode
=
op
.
mode
# the GPU ops expect exactly 2 non-pooling dimensions
if
inp
.
ndim
==
nd
+
2
:
return
GpuDnnPoolGrad
(
mode
=
mode
)(
inp
,
out
,
...
...
@@ -1940,12 +1942,14 @@ def local_gpua_avg_pool_dnn_grad_stride(op, ctx_name, inputs, outputs):
out_grad
=
gpu_contiguous
(
as_gpuarray_variable
(
out_grad
,
ctx_name
))
mode
=
op
.
mode
# the GPU ops expect exactly 2 non-pooling dimensions
if
inp
.
ndim
==
nd
+
2
:
# We reuse out_grad because cuDNN does not use the value of the `out`
# argument but still checks its shape for average pooling. This
# has been observed in v2 and v3 as far as I know.
return
GpuDnnPoolGrad
(
mode
=
mode
)(
inp
,
out_grad
,
out_grad
,
ws
,
stride
,
pad
)
else
:
# reshape to 4D or 5D with 2 non-pooling dimensions
inp_padded
=
pad_dims
(
inp
,
2
,
nd
)
out_grad_padded
=
pad_dims
(
out_grad
,
2
,
nd
)
ret_padded
=
GpuDnnPoolGrad
(
mode
=
mode
)(
inp_padded
,
...
...
theano/sandbox/cuda/dnn.py
浏览文件 @
3cc0686e
...
...
@@ -2981,6 +2981,7 @@ if True:
if
nd
not
in
(
2
,
3
):
return
if
(
img
.
owner
and
isinstance
(
img
.
owner
.
op
,
HostFromGpu
)):
# dnn_pool expects exactly 2 non-pooling dimensions
if
img
.
ndim
==
nd
+
2
:
ret
=
dnn_pool
(
gpu_contiguous
(
img
.
owner
.
inputs
[
0
]),
ws
,
stride
=
stride
,
pad
=
pad
,
mode
=
mode
)
...
...
@@ -3027,6 +3028,7 @@ if True:
(
out
.
owner
and
isinstance
(
out
.
owner
.
op
,
HostFromGpu
))
or
(
inp_grad
.
owner
and
isinstance
(
inp_grad
.
owner
.
op
,
HostFromGpu
))):
# the GPU ops expect exactly 2 non-pooling dimensions
if
inp
.
ndim
==
nd
+
2
:
ret
=
GpuDnnPoolGrad
(
mode
=
mode
)(
gpu_contiguous
(
inp
),
gpu_contiguous
(
out
),
...
...
@@ -3061,6 +3063,7 @@ if True:
if
((
inp
.
owner
and
isinstance
(
inp
.
owner
.
op
,
HostFromGpu
))
or
(
inp_grad
.
owner
and
isinstance
(
inp_grad
.
owner
.
op
,
HostFromGpu
))):
# the GPU ops expect exactly 2 non-pooling dimensions
if
inp
.
ndim
==
nd
+
2
:
contiguous_inp_grad
=
gpu_contiguous
(
inp_grad
)
ret
=
GpuDnnPoolGrad
(
mode
=
mode
)(
gpu_contiguous
(
inp
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论