Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
dc2277cc
提交
dc2277cc
authored
4月 06, 2016
作者:
Mathieu Germain
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added winograd to old backend
上级
bec034eb
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
33 行增加
和
14 行删除
+33
-14
dnn.py
theano/sandbox/cuda/dnn.py
+33
-14
没有找到文件。
theano/sandbox/cuda/dnn.py
浏览文件 @
dc2277cc
...
...
@@ -296,7 +296,7 @@ class GpuDnnConv(DnnBase, COp):
workmem
*deprecated*, use parameter algo instead.
algo
['none', 'small', 'large', 'fft', 'fft_tiling', 'guess_once',
['none', 'small', 'large', 'fft', 'fft_tiling', 'guess_once',
'winograd',
'guess_on_shape_change', 'time_once', 'time_on_shape_change']
Default is the value of :attr:`config.dnn.conv.algo_fwd`.
...
...
@@ -345,8 +345,13 @@ class GpuDnnConv(DnnBase, COp):
raise
RuntimeError
(
"CuDNN tiled-FFT convolution requires "
"CuDNN v4 or more recent"
)
if
version
()
<
(
5000
,
5000
):
if
self
.
algo
==
'winograd'
:
raise
RuntimeError
(
"CuDNN winograd convolution requires "
"CuDNN v5 or more recent"
)
assert
self
.
algo
in
[
'none'
,
'small'
,
'large'
,
'fft'
,
'fft_tiling'
,
'guess_once'
,
'guess_on_shape_change'
,
'
winograd'
,
'
guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]
def
__setstate__
(
self
,
d
):
...
...
@@ -481,7 +486,7 @@ class GpuDnnConv3d(GpuDnnConv):
:param descr: the convolution descriptor
:param workmem:
*deprecated*, use parameter algo instead.
:param algo: ['none', 'small', 'fft_tiling',
:param algo: ['none', 'small', 'fft_tiling',
'winograd',
'guess_once', 'guess_on_shape_change',
'time_once', 'time_on_shape_change']
Default is the value of :attr:`config.dnn.conv.algo_fwd`.
...
...
@@ -497,7 +502,8 @@ class GpuDnnConv3d(GpuDnnConv):
"Use 'algo' instead."
),
stacklevel
=
3
)
assert
algo
is
None
algo
=
workmem
good_algo
=
[
'none'
,
'small'
,
'fft_tiling'
,
good_algo
=
[
'none'
,
'small'
,
'fft_tiling'
,
'winograd'
,
'guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]
if
algo
is
None
and
config
.
dnn
.
conv
.
algo_fwd
not
in
good_algo
:
...
...
@@ -505,11 +511,16 @@ class GpuDnnConv3d(GpuDnnConv):
elif
algo
is
not
None
and
algo
not
in
good_algo
:
algo
=
'guess_once'
super
(
GpuDnnConv3d
,
self
)
.
__init__
(
inplace
=
inplace
,
algo
=
algo
)
assert
self
.
algo
in
good_algo
if
version
()
<
(
5000
,
5000
):
if
self
.
algo
==
'fft_tiling'
:
raise
RuntimeError
(
"CuDNN 3d tiled-FFT convolution requires "
"CuDNN v5 or more recent"
)
elif
self
.
algo
==
'winograd'
:
raise
RuntimeError
(
"CuDNN 3d winograd convolution requires "
"CuDNN v5 or more recent"
)
def
make_node
(
self
,
img
,
kern
,
output
,
desc
,
alpha
=
None
,
beta
=
None
):
...
...
@@ -791,9 +802,8 @@ class GpuDnnConvGradI(DnnBase, COp):
workmem
*deprecated*, use parameter algo instead.
algo
['none', 'deterministic', 'fft', 'fft_tiling', 'guess_once',
'guess_on_shape_change', 'time_once',
'time_on_shape_change']
['none', 'deterministic', 'fft', 'fft_tiling', 'winograd', 'guess_once',
'guess_on_shape_change', 'time_once', 'time_on_shape_change']
Default is the value of :attr:`config.dnn.conv.algo_bwd_data`.
...
...
@@ -828,8 +838,13 @@ class GpuDnnConvGradI(DnnBase, COp):
raise
RuntimeError
(
"CuDNN's tiled-FFT convolution requires "
"CuDNN v4 or more recent"
)
if
version
()
<
(
5000
,
5000
):
if
self
.
algo
==
'winograd'
:
raise
RuntimeError
(
"CuDNN's winograd convolution requires "
"CuDNN v5 or more recent"
)
assert
self
.
algo
in
[
'none'
,
'deterministic'
,
'fft'
,
'fft_tiling'
,
'guess_once'
,
'guess_on_shape_change'
,
'
winograd'
,
'
guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]
def
__setstate__
(
self
,
d
):
...
...
@@ -946,9 +961,8 @@ class GpuDnnConv3dGradI(GpuDnnConvGradI):
:param descr: the convolution descriptor
:param workmem:
*deprecated*, use parameter algo instead.
:param algo: ['none', 'deterministic, 'fft_tiling',
'guess_once', 'guess_on_shape_change',
'time_once', 'time_on_shape_change']
:param algo: ['none', 'deterministic, 'fft_tiling', 'winograd', 'guess_once',
'guess_on_shape_change', 'time_once', 'time_on_shape_change']
Default is the value of :attr:`config.dnn.conv.algo_bwd_data`.
...
...
@@ -963,9 +977,11 @@ class GpuDnnConv3dGradI(GpuDnnConvGradI):
"deprecated. Use 'algo' instead."
),
stacklevel
=
3
)
assert
algo
is
None
algo
=
workmem
good_algo
=
[
'none'
,
'deterministic'
,
'fft_tiling'
,
'guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]
good_algo
=
[
'none'
,
'deterministic'
,
'fft_tiling'
,
'winograd'
,
'guess_once'
,
'guess_on_shape_change'
,
'time_once'
,
'time_on_shape_change'
]
if
algo
is
None
and
config
.
dnn
.
conv
.
algo_bwd_data
not
in
good_algo
:
algo
=
'guess_once'
elif
algo
is
not
None
and
algo
not
in
good_algo
:
...
...
@@ -977,6 +993,9 @@ class GpuDnnConv3dGradI(GpuDnnConvGradI):
if
self
.
algo
==
'fft_tiling'
:
raise
RuntimeError
(
"CuDNN 3d tiled-FFT convolution requires "
"CuDNN v5 or more recent"
)
elif
self
.
algo
==
'winograd'
:
raise
RuntimeError
(
"CuDNN 3d winograd convolution requires "
"CuDNN v5 or more recent"
)
def
grad
(
self
,
inp
,
grads
):
kerns
,
top
,
output
,
desc
,
alpha
,
beta
=
inp
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论