Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8c9b612b
提交
8c9b612b
authored
9月 29, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Type context for dnn.py
上级
e4a14f54
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
18 行增加
和
18 行删除
+18
-18
dnn.py
theano/sandbox/gpuarray/dnn.py
+0
-0
dnn_base.c
theano/sandbox/gpuarray/dnn_base.c
+3
-3
dnn_fwd.c
theano/sandbox/gpuarray/dnn_fwd.c
+2
-2
dnn_gi.c
theano/sandbox/gpuarray/dnn_gi.c
+2
-2
dnn_gw.c
theano/sandbox/gpuarray/dnn_gw.c
+2
-2
dnn_pool.c
theano/sandbox/gpuarray/dnn_pool.c
+2
-2
dnn_pool_grad.c
theano/sandbox/gpuarray/dnn_pool_grad.c
+3
-3
dnn_softmax.c
theano/sandbox/gpuarray/dnn_softmax.c
+2
-2
dnn_softmax_grad.c
theano/sandbox/gpuarray/dnn_softmax_grad.c
+2
-2
没有找到文件。
theano/sandbox/gpuarray/dnn.py
浏览文件 @
8c9b612b
差异被折叠。
点击展开。
theano/sandbox/gpuarray/dnn_base.c
浏览文件 @
8c9b612b
...
@@ -107,14 +107,14 @@ cudnnHandle_t APPLY_SPECIFIC(_handle);
...
@@ -107,14 +107,14 @@ cudnnHandle_t APPLY_SPECIFIC(_handle);
#section init_code_struct
#section init_code_struct
{
{
cuda_enter
(
pygpu_default_context
()
->
ctx
);
cuda_enter
(
CONTEXT
->
ctx
);
cudnnStatus_t
err
;
cudnnStatus_t
err
;
APPLY_SPECIFIC
(
_handle
)
=
NULL
;
APPLY_SPECIFIC
(
_handle
)
=
NULL
;
if
((
err
=
cudnnCreate
(
&
APPLY_SPECIFIC
(
_handle
)))
!=
CUDNN_STATUS_SUCCESS
)
{
if
((
err
=
cudnnCreate
(
&
APPLY_SPECIFIC
(
_handle
)))
!=
CUDNN_STATUS_SUCCESS
)
{
PyErr_Format
(
PyExc_RuntimeError
,
"could not create cuDNN handle: %s"
,
PyErr_Format
(
PyExc_RuntimeError
,
"could not create cuDNN handle: %s"
,
cudnnGetErrorString
(
err
));
cudnnGetErrorString
(
err
));
cuda_exit
(
pygpu_default_context
()
->
ctx
);
cuda_exit
(
CONTEXT
->
ctx
);
FAIL
;
FAIL
;
}
}
cuda_exit
(
pygpu_default_context
()
->
ctx
);
cuda_exit
(
CONTEXT
->
ctx
);
}
}
theano/sandbox/gpuarray/dnn_fwd.c
浏览文件 @
8c9b612b
...
@@ -5,12 +5,12 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
...
@@ -5,12 +5,12 @@ APPLY_SPECIFIC(conv_fwd)(PyGpuArrayObject *input, PyGpuArrayObject *kerns,
PyGpuArrayObject
*
om
,
PyGpuArrayObject
*
om
,
cudnnConvolutionDescriptor_t
desc
,
cudnnConvolutionDescriptor_t
desc
,
double
alpha
,
double
beta
,
double
alpha
,
double
beta
,
PyGpuArrayObject
**
output
)
{
PyGpuArrayObject
**
output
,
PyGpuContextObject
*
c
)
{
cudnnStatus_t
err
=
CUDNN_STATUS_SUCCESS
;
cudnnStatus_t
err
=
CUDNN_STATUS_SUCCESS
;
float
af
=
alpha
,
bf
=
beta
;
float
af
=
alpha
,
bf
=
beta
;
void
*
alpha_p
;
void
*
alpha_p
;
void
*
beta_p
;
void
*
beta_p
;
PyGpuContextObject
*
c
=
pygpu_default_context
();
if
(
PyGpuArray_DIMS
(
input
)[
1
]
!=
PyGpuArray_DIMS
(
kerns
)[
1
])
{
if
(
PyGpuArray_DIMS
(
input
)[
1
]
!=
PyGpuArray_DIMS
(
kerns
)[
1
])
{
PyErr_SetString
(
PyExc_ValueError
,
PyErr_SetString
(
PyExc_ValueError
,
...
...
theano/sandbox/gpuarray/dnn_gi.c
浏览文件 @
8c9b612b
...
@@ -4,12 +4,12 @@ int
...
@@ -4,12 +4,12 @@ int
APPLY_SPECIFIC
(
conv_gi
)(
PyGpuArrayObject
*
kerns
,
PyGpuArrayObject
*
output
,
APPLY_SPECIFIC
(
conv_gi
)(
PyGpuArrayObject
*
kerns
,
PyGpuArrayObject
*
output
,
PyGpuArrayObject
*
im
,
PyGpuArrayObject
*
im
,
cudnnConvolutionDescriptor_t
desc
,
cudnnConvolutionDescriptor_t
desc
,
double
alpha
,
double
beta
,
PyGpuArrayObject
**
input
)
{
double
alpha
,
double
beta
,
PyGpuArrayObject
**
input
,
PyGpuContextObject
*
c
)
{
cudnnStatus_t
err
=
CUDNN_STATUS_SUCCESS
;
cudnnStatus_t
err
=
CUDNN_STATUS_SUCCESS
;
float
af
=
alpha
,
bf
=
beta
;
float
af
=
alpha
,
bf
=
beta
;
void
*
alpha_p
;
void
*
alpha_p
;
void
*
beta_p
;
void
*
beta_p
;
PyGpuContextObject
*
c
=
pygpu_default_context
();
if
(
PyGpuArray_DIMS
(
im
)[
1
]
!=
PyGpuArray_DIMS
(
kerns
)[
1
])
{
if
(
PyGpuArray_DIMS
(
im
)[
1
]
!=
PyGpuArray_DIMS
(
kerns
)[
1
])
{
PyErr_SetString
(
PyExc_ValueError
,
"images and kernel must have the same "
PyErr_SetString
(
PyExc_ValueError
,
"images and kernel must have the same "
...
...
theano/sandbox/gpuarray/dnn_gw.c
浏览文件 @
8c9b612b
...
@@ -4,12 +4,12 @@ int
...
@@ -4,12 +4,12 @@ int
APPLY_SPECIFIC
(
conv_gw
)(
PyGpuArrayObject
*
input
,
PyGpuArrayObject
*
output
,
APPLY_SPECIFIC
(
conv_gw
)(
PyGpuArrayObject
*
input
,
PyGpuArrayObject
*
output
,
PyGpuArrayObject
*
km
,
PyGpuArrayObject
*
km
,
cudnnConvolutionDescriptor_t
desc
,
cudnnConvolutionDescriptor_t
desc
,
double
alpha
,
double
beta
,
PyGpuArrayObject
**
kerns
)
{
double
alpha
,
double
beta
,
PyGpuArrayObject
**
kerns
,
PyGpuContextObject
*
c
)
{
cudnnStatus_t
err
=
CUDNN_STATUS_SUCCESS
;
cudnnStatus_t
err
=
CUDNN_STATUS_SUCCESS
;
float
af
=
alpha
,
bf
=
beta
;
float
af
=
alpha
,
bf
=
beta
;
void
*
alpha_p
;
void
*
alpha_p
;
void
*
beta_p
;
void
*
beta_p
;
PyGpuContextObject
*
c
=
pygpu_default_context
();
if
(
PyGpuArray_DIMS
(
input
)[
1
]
!=
PyGpuArray_DIMS
(
km
)[
1
])
{
if
(
PyGpuArray_DIMS
(
input
)[
1
]
!=
PyGpuArray_DIMS
(
km
)[
1
])
{
PyErr_SetString
(
PyExc_ValueError
,
PyErr_SetString
(
PyExc_ValueError
,
...
...
theano/sandbox/gpuarray/dnn_pool.c
浏览文件 @
8c9b612b
...
@@ -29,10 +29,10 @@ if (APPLY_SPECIFIC(output) != NULL) { cudnnDestroyTensorDescriptor(APPLY_SPECIFI
...
@@ -29,10 +29,10 @@ if (APPLY_SPECIFIC(output) != NULL) { cudnnDestroyTensorDescriptor(APPLY_SPECIFI
int
APPLY_SPECIFIC
(
dnn_pool
)(
PyGpuArrayObject
*
img
,
int
APPLY_SPECIFIC
(
dnn_pool
)(
PyGpuArrayObject
*
img
,
cudnnPoolingDescriptor_t
desc
,
cudnnPoolingDescriptor_t
desc
,
PyGpuArrayObject
**
out
)
{
PyGpuArrayObject
**
out
,
PyGpuContextObject
*
c
)
{
cudnnStatus_t
err
;
cudnnStatus_t
err
;
size_t
dims
[
5
];
size_t
dims
[
5
];
PyGpuContextObject
*
c
=
pygpu_default_context
();
if
(
!
GpuArray_IS_C_CONTIGUOUS
(
&
img
->
ga
))
{
if
(
!
GpuArray_IS_C_CONTIGUOUS
(
&
img
->
ga
))
{
PyErr_SetString
(
PyExc_ValueError
,
"Only contiguous inputs are supported."
);
PyErr_SetString
(
PyExc_ValueError
,
"Only contiguous inputs are supported."
);
...
...
theano/sandbox/gpuarray/dnn_pool_grad.c
浏览文件 @
8c9b612b
...
@@ -53,9 +53,9 @@ int APPLY_SPECIFIC(dnn_pool_grad)(PyGpuArrayObject *inp,
...
@@ -53,9 +53,9 @@ int APPLY_SPECIFIC(dnn_pool_grad)(PyGpuArrayObject *inp,
PyGpuArrayObject
*
out
,
PyGpuArrayObject
*
out
,
PyGpuArrayObject
*
out_grad
,
PyGpuArrayObject
*
out_grad
,
cudnnPoolingDescriptor_t
desc
,
cudnnPoolingDescriptor_t
desc
,
PyGpuArrayObject
**
inp_grad
)
{
PyGpuArrayObject
**
inp_grad
,
PyGpuContextObject
*
c
)
{
cudnnStatus_t
err
;
cudnnStatus_t
err
;
PyGpuContextObject
*
c
=
pygpu_default_context
();
if
(
!
GpuArray_IS_C_CONTIGUOUS
(
&
inp
->
ga
))
{
if
(
!
GpuArray_IS_C_CONTIGUOUS
(
&
inp
->
ga
))
{
PyErr_SetString
(
PyExc_ValueError
,
"Only contiguous inputs are supported."
);
PyErr_SetString
(
PyExc_ValueError
,
"Only contiguous inputs are supported."
);
...
@@ -81,7 +81,7 @@ int APPLY_SPECIFIC(dnn_pool_grad)(PyGpuArrayObject *inp,
...
@@ -81,7 +81,7 @@ int APPLY_SPECIFIC(dnn_pool_grad)(PyGpuArrayObject *inp,
if
(
theano_prep_output
(
inp_grad
,
PyGpuArray_NDIM
(
inp
),
if
(
theano_prep_output
(
inp_grad
,
PyGpuArray_NDIM
(
inp
),
PyGpuArray_DIMS
(
inp
),
inp
->
ga
.
typecode
,
PyGpuArray_DIMS
(
inp
),
inp
->
ga
.
typecode
,
GA_C_ORDER
,
pygpu_default_context
()
)
!=
0
)
{
GA_C_ORDER
,
c
)
!=
0
)
{
return
1
;
return
1
;
}
}
...
...
theano/sandbox/gpuarray/dnn_softmax.c
浏览文件 @
8c9b612b
...
@@ -34,9 +34,9 @@ if (APPLY_SPECIFIC(output) != NULL)
...
@@ -34,9 +34,9 @@ if (APPLY_SPECIFIC(output) != NULL)
#section support_code_struct
#section support_code_struct
int
APPLY_SPECIFIC
(
softmax
)(
PyGpuArrayObject
*
x
,
int
APPLY_SPECIFIC
(
softmax
)(
PyGpuArrayObject
*
x
,
PyGpuArrayObject
**
out
)
{
PyGpuArrayObject
**
out
,
PyGpuContextObject
*
c
)
{
cudnnStatus_t
err
;
cudnnStatus_t
err
;
PyGpuContextObject
*
c
=
pygpu_default_context
();
if
(
c_set_tensorNd
(
x
,
APPLY_SPECIFIC
(
input
))
!=
0
)
if
(
c_set_tensorNd
(
x
,
APPLY_SPECIFIC
(
input
))
!=
0
)
return
1
;
return
1
;
...
...
theano/sandbox/gpuarray/dnn_softmax_grad.c
浏览文件 @
8c9b612b
...
@@ -45,9 +45,9 @@ if (APPLY_SPECIFIC(dx) != NULL)
...
@@ -45,9 +45,9 @@ if (APPLY_SPECIFIC(dx) != NULL)
int
APPLY_SPECIFIC
(
softmax_grad
)(
PyGpuArrayObject
*
dy
,
int
APPLY_SPECIFIC
(
softmax_grad
)(
PyGpuArrayObject
*
dy
,
PyGpuArrayObject
*
sm
,
PyGpuArrayObject
*
sm
,
PyGpuArrayObject
**
dx
)
{
PyGpuArrayObject
**
dx
,
PyGpuContextObject
*
c
)
{
cudnnStatus_t
err
;
cudnnStatus_t
err
;
PyGpuContextObject
*
c
=
pygpu_default_context
();
if
(
c_set_tensorNd
(
dy
,
APPLY_SPECIFIC
(
dy
))
!=
0
)
if
(
c_set_tensorNd
(
dy
,
APPLY_SPECIFIC
(
dy
))
!=
0
)
return
1
;
return
1
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论