Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c1c79619
提交
c1c79619
authored
3月 12, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix cudnn v1 crash
上级
9c99081d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
4 行删除
+11
-4
dnn.py
theano/sandbox/cuda/dnn.py
+10
-3
opt.py
theano/sandbox/cuda/opt.py
+1
-1
没有找到文件。
theano/sandbox/cuda/dnn.py
浏览文件 @
c1c79619
...
@@ -649,12 +649,19 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
...
@@ -649,12 +649,19 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
capability of 3.0 or higer. This means that older GPU will not
capability of 3.0 or higer. This means that older GPU will not
work with this Op.
work with this Op.
"""
"""
def
contig_version
(
var
):
if
version
()
==
-
1
:
var
=
gpu_contiguous
(
var
)
else
:
var
=
cp_on_negative_strides
(
var
)
return
var
fgraph
=
getattr
(
img
,
'fgraph'
,
None
)
or
getattr
(
kerns
,
'fgraph'
,
None
)
fgraph
=
getattr
(
img
,
'fgraph'
,
None
)
or
getattr
(
kerns
,
'fgraph'
,
None
)
if
(
border_mode
==
'valid'
and
subsample
==
(
1
,
1
)
and
if
(
border_mode
==
'valid'
and
subsample
==
(
1
,
1
)
and
direction_hint
==
'bprop weights'
):
direction_hint
==
'bprop weights'
):
# Special case: We are asked to use GpuDnnConvGradW. We need to set
# Special case: We are asked to use GpuDnnConvGradW. We need to set
# up a suitable 'fake' convolution to compute the gradient for.
# up a suitable 'fake' convolution to compute the gradient for.
img
=
c
p_on_negative_strides
(
img
.
dimshuffle
(
1
,
0
,
2
,
3
))
img
=
c
ontig_version
(
img
.
dimshuffle
(
1
,
0
,
2
,
3
))
if
conv_mode
==
'conv'
:
if
conv_mode
==
'conv'
:
# We need to flip manually. These 'kerns' are not the kernels
# We need to flip manually. These 'kerns' are not the kernels
# that would be flipped by conv_mode='conv' in GpuDnnConvGradW.
# that would be flipped by conv_mode='conv' in GpuDnnConvGradW.
...
@@ -686,9 +693,9 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
...
@@ -686,9 +693,9 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
return
GpuDnnConvGradI
()(
kerns
,
img
,
out
,
desc
)
return
GpuDnnConvGradI
()(
kerns
,
img
,
out
,
desc
)
# Standard case: We use GpuDnnConv with suitable padding.
# Standard case: We use GpuDnnConv with suitable padding.
# c
p_on_negative_strides
will return a gpu_contiguous copy
# c
ontig_version
will return a gpu_contiguous copy
# if the img contains negative strides
# if the img contains negative strides
img
=
c
p_on_negative_strides
(
img
)
img
=
c
ontig_version
(
img
)
kerns
=
gpu_contiguous
(
kerns
)
kerns
=
gpu_contiguous
(
kerns
)
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
desc
=
GpuDnnConvDesc
(
border_mode
=
border_mode
,
subsample
=
subsample
,
conv_mode
=
conv_mode
)(
img
.
shape
,
kerns
.
shape
)
conv_mode
=
conv_mode
)(
img
.
shape
,
kerns
.
shape
)
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
c1c79619
...
@@ -1763,7 +1763,7 @@ def get_device_type_sizes():
...
@@ -1763,7 +1763,7 @@ def get_device_type_sizes():
del
t
del
t
except
Exception
,
e
:
except
Exception
,
e
:
_logger
.
warning
((
"Optimization Warning: "
_logger
.
warning
((
"Optimization Warning: "
"Got the following error, but
we
can ignore it. "
"Got the following error, but
you
can ignore it. "
"This could cause less GpuElemwise fused together.
\n
"
"This could cause less GpuElemwise fused together.
\n
"
"
%
s"
)
%
e
)
"
%
s"
)
%
e
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论