Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f748cf87
提交
f748cf87
authored
6月 22, 2015
作者:
Nicolas Ballas
提交者:
--global
8月 04, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix rebase issues
上级
822c06d4
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
12 行删除
+13
-12
dnn.py
theano/sandbox/cuda/dnn.py
+7
-6
dnn_gi.c
theano/sandbox/cuda/dnn_gi.c
+5
-5
dnn_gw.c
theano/sandbox/cuda/dnn_gw.c
+1
-1
没有找到文件。
theano/sandbox/cuda/dnn.py
浏览文件 @
f748cf87
...
@@ -374,7 +374,7 @@ class GpuDnnConvDesc(GpuOp):
...
@@ -374,7 +374,7 @@ class GpuDnnConvDesc(GpuOp):
AddConfigVar
(
'dnn.conv.workmem'
,
AddConfigVar
(
'dnn.conv.workmem'
,
"Default value for the workmem attribute of cudnn convolutions."
,
"Default value for the workmem attribute of cudnn convolutions."
,
EnumStr
(
'
small'
,
'none
'
,
'large'
,
'fft'
,
'guess'
,
'time'
),
EnumStr
(
'
none'
,
'small
'
,
'large'
,
'fft'
,
'guess'
,
'time'
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'dnn.conv.workmem_bwd'
,
AddConfigVar
(
'dnn.conv.workmem_bwd'
,
...
@@ -713,11 +713,11 @@ class GpuDnnConv3d(GpuDnnConv):
...
@@ -713,11 +713,11 @@ class GpuDnnConv3d(GpuDnnConv):
def
__init__
(
self
,
workmem
=
None
,
inplace
=
False
):
def
__init__
(
self
,
workmem
=
None
,
inplace
=
False
):
"""
"""
:param workmem: either 'none' 'time' or 'guess'.
:param workmem: either 'none'
,
'time' or 'guess'.
Default is the value of :attr:`config.dnn.conv.workmem`.
Default is the value of :attr:`config.dnn.conv.workmem`.
"""
"""
super
(
GpuDnnConv3d
,
self
)
.
__init__
(
workmem
=
'guess'
,
inplace
=
inplace
)
super
(
GpuDnnConv3d
,
self
)
.
__init__
(
workmem
=
'guess'
,
inplace
=
inplace
)
assert
self
.
workmem
in
[
'none'
'time'
,
'guess'
]
assert
self
.
workmem
in
[
'none'
,
'time'
,
'guess'
]
def
make_node
(
self
,
img
,
kern
,
output
,
desc
,
alpha
=
None
,
beta
=
None
,
nb_dim
=
None
):
def
make_node
(
self
,
img
,
kern
,
output
,
desc
,
alpha
=
None
,
beta
=
None
,
nb_dim
=
None
):
...
@@ -907,8 +907,8 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW):
...
@@ -907,8 +907,8 @@ class GpuDnnConv3dGradW(GpuDnnConvGradW):
__input_name__
=
(
'image'
,
'grad'
,
'output'
,
'descriptor'
,
'alpha'
,
'beta'
)
__input_name__
=
(
'image'
,
'grad'
,
'output'
,
'descriptor'
,
'alpha'
,
'beta'
)
def
__init__
(
self
,
inplace
=
False
,
workmem
=
None
):
def
__init__
(
self
,
inplace
=
False
,
workmem
=
None
):
### Only workmem = 'none' work with cudnn conv 3d
super
(
GpuDnnConv3dGradW
,
self
)
.
__init__
(
inplace
=
inplace
,
workmem
=
'none'
)
super
(
GpuDnnConv3dGradW
,
self
)
.
__init__
(
inplace
=
inplace
,
workmem
=
'none'
)
assert
self
.
workmem
in
[
'none'
,
'time'
,
'guess'
]
def
grad
(
self
,
inp
,
grads
):
def
grad
(
self
,
inp
,
grads
):
img
,
top
,
output
,
desc
,
alpha
,
beta
,
nb_dim
=
inp
img
,
top
,
output
,
desc
,
alpha
,
beta
,
nb_dim
=
inp
...
@@ -1064,8 +1064,9 @@ class GpuDnnConv3dGradI(GpuDnnConvGradI):
...
@@ -1064,8 +1064,9 @@ class GpuDnnConv3dGradI(GpuDnnConvGradI):
__input_name__
=
(
'kernel'
,
'grad'
,
'output'
,
__input_name__
=
(
'kernel'
,
'grad'
,
'output'
,
'descriptor'
,
'alpha'
,
'beta'
)
'descriptor'
,
'alpha'
,
'beta'
)
def
__init__
(
self
,
inplace
=
False
):
def
__init__
(
self
,
inplace
=
False
,
workmem
=
None
):
super
(
GpuDnnConv3dGradI
,
self
)
.
__init__
(
inplace
)
super
(
GpuDnnConv3dGradI
,
self
)
.
__init__
(
inplace
,
workmem
)
assert
self
.
workmem
in
[
'none'
,
'time'
,
'guess'
]
def
grad
(
self
,
inp
,
grads
):
def
grad
(
self
,
inp
,
grads
):
...
...
theano/sandbox/cuda/dnn_gi.c
浏览文件 @
f748cf87
...
@@ -41,11 +41,11 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
...
@@ -41,11 +41,11 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
// Check if the kernels and the output have the same shape as they have
// Check if the kernels and the output have the same shape as they have
// last time the apply node was executed
// last time the apply node was executed
bool
same_shapes
=
true
;
bool
same_shapes
=
true
;
for
(
int
i
=
0
;
(
i
<
4
)
&&
same_shapes
;
i
++
)
for
(
int
i
=
0
;
(
i
<
nb_dim
)
&&
same_shapes
;
i
++
)
{
{
same_shapes
&=
(
CudaNdarray_HOST_DIMS
(
kerns
)[
i
]
!
=
same_shapes
&=
(
CudaNdarray_HOST_DIMS
(
kerns
)[
i
]
=
=
APPLY_SPECIFIC
(
previous_kerns_shape
)[
i
]);
APPLY_SPECIFIC
(
previous_kerns_shape
)[
i
]);
same_shapes
&=
(
CudaNdarray_HOST_DIMS
(
output
)[
i
]
!
=
same_shapes
&=
(
CudaNdarray_HOST_DIMS
(
output
)[
i
]
=
=
APPLY_SPECIFIC
(
previous_output_shape
)[
i
]);
APPLY_SPECIFIC
(
previous_output_shape
)[
i
]);
}
}
...
@@ -86,7 +86,7 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
...
@@ -86,7 +86,7 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
// Store the shapes of the kernels and output as well as the chosen
// Store the shapes of the kernels and output as well as the chosen
// algorithm for future use.
// algorithm for future use.
APPLY_SPECIFIC
(
previous_bwd_d_algo
)
=
chosen_algo
;
APPLY_SPECIFIC
(
previous_bwd_d_algo
)
=
chosen_algo
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
nb_dim
;
i
++
)
{
{
APPLY_SPECIFIC
(
previous_kerns_shape
)[
i
]
=
APPLY_SPECIFIC
(
previous_kerns_shape
)[
i
]
=
CudaNdarray_HOST_DIMS
(
kerns
)[
i
];
CudaNdarray_HOST_DIMS
(
kerns
)[
i
];
...
@@ -113,7 +113,7 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
...
@@ -113,7 +113,7 @@ APPLY_SPECIFIC(conv_gi)(CudaNdarray *kerns, CudaNdarray *output,
// If the chosen implementation is FFT, validate that it can be used
// If the chosen implementation is FFT, validate that it can be used
// on the current data and default on a safe implementation if it
// on the current data and default on a safe implementation if it
// can't.
// can't.
if
(
chosen_algo
==
CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT
)
if
(
chosen_algo
==
CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT
&&
nb_dim
==
4
)
{
{
// Extract the properties of the convolution descriptor
// Extract the properties of the convolution descriptor
...
...
theano/sandbox/cuda/dnn_gw.c
浏览文件 @
f748cf87
...
@@ -113,7 +113,7 @@ APPLY_SPECIFIC(conv_gw)(CudaNdarray *input, CudaNdarray *output,
...
@@ -113,7 +113,7 @@ APPLY_SPECIFIC(conv_gw)(CudaNdarray *input, CudaNdarray *output,
// If the chosen implementation is FFT, validate that it can be used
// If the chosen implementation is FFT, validate that it can be used
// on the current data and default on a safe implementation if it
// on the current data and default on a safe implementation if it
// can't.
// can't.
if
(
chosen_algo
==
CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT
)
if
(
chosen_algo
==
CUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT
&&
nb_dim
==
4
)
{
{
// Extract the properties of the convolution descriptor
// Extract the properties of the convolution descriptor
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论