Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
44cffc55
提交
44cffc55
authored
10月 23, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix doc syntax
上级
16503fe9
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
19 行增加
和
12 行删除
+19
-12
blas.py
theano/sandbox/cuda/blas.py
+4
-2
blocksparse.py
theano/sandbox/cuda/blocksparse.py
+15
-10
没有找到文件。
theano/sandbox/cuda/blas.py
浏览文件 @
44cffc55
...
@@ -1362,7 +1362,8 @@ class GpuCorr3dMM_gradWeights(BaseGpuCorr3dMM):
...
@@ -1362,7 +1362,8 @@ class GpuCorr3dMM_gradWeights(BaseGpuCorr3dMM):
"""Gradient wrt. filters for `GpuCorr3dMM`.
"""Gradient wrt. filters for `GpuCorr3dMM`.
:note: You will not want to use this directly, but rely on Theano's
:note: You will not want to use this directly, but rely on Theano's
automatic differentiation or graph optimization to use it as needed."""
automatic differentiation or graph optimization to use it as needed.
"""
def
__init__
(
self
,
border_mode
=
"valid"
,
def
__init__
(
self
,
border_mode
=
"valid"
,
subsample
=
(
1
,
1
,
1
),
subsample
=
(
1
,
1
,
1
),
...
@@ -1417,7 +1418,8 @@ class GpuCorr3dMM_gradInputs(BaseGpuCorr3dMM):
...
@@ -1417,7 +1418,8 @@ class GpuCorr3dMM_gradInputs(BaseGpuCorr3dMM):
"""Gradient wrt. inputs for `GpuCorr3dMM`.
"""Gradient wrt. inputs for `GpuCorr3dMM`.
:note: You will not want to use this directly, but rely on Theano's
:note: You will not want to use this directly, but rely on Theano's
automatic differentiation or graph optimization to use it as needed."""
automatic differentiation or graph optimization to use it as needed.
"""
def
__init__
(
self
,
border_mode
=
"valid"
,
def
__init__
(
self
,
border_mode
=
"valid"
,
subsample
=
(
1
,
1
,
1
),
subsample
=
(
1
,
1
,
1
),
...
...
theano/sandbox/cuda/blocksparse.py
浏览文件 @
44cffc55
...
@@ -13,6 +13,7 @@ if cuda_available:
...
@@ -13,6 +13,7 @@ if cuda_available:
HostFromGpu
,
host_from_gpu
,
HostFromGpu
,
host_from_gpu
,
GpuDimShuffle
)
GpuDimShuffle
)
class
SparseBlockGemvSS
(
GpuOp
):
class
SparseBlockGemvSS
(
GpuOp
):
"""
"""
This op computes the dot product of specified pieces of vectors
This op computes the dot product of specified pieces of vectors
...
@@ -183,7 +184,8 @@ static int SparseBlockGemv_copy(PyArrayObject *a, npy_intp *b) {
...
@@ -183,7 +184,8 @@ static int SparseBlockGemv_copy(PyArrayObject *a, npy_intp *b) {
cudaMemcpyHostToDevice);
cudaMemcpyHostToDevice);
Py_DECREF(aa);
Py_DECREF(aa);
if (err != cudaSuccess) {
if (err != cudaSuccess) {
PyErr_SetString(PyExc_RuntimeError, "Cannot copy index data to GPU");
PyErr_Format(PyExc_RuntimeError, "Cannot copy index data to GPU (
%
s)",
cudaGetErrorString(err));
return -1;
return -1;
}
}
return 0;
return 0;
...
@@ -241,11 +243,11 @@ Py_INCREF(%(out)s);
...
@@ -241,11 +243,11 @@ Py_INCREF(%(out)s);
res
=
"""
res
=
"""
if (CudaNdarray_prep_output(&
%(out)
s, 3, CudaNdarray_HOST_DIMS(
%(o)
s)))
if (CudaNdarray_prep_output(&
%(out)
s, 3, CudaNdarray_HOST_DIMS(
%(o)
s)))
{
{
PyErr_SetString(PyExc_RuntimeError, "Cannot allocate output");
// Error already set
%(fail)
s
%(fail)
s
}
}
if (CudaNdarray_CopyFromCudaNdarray(
%(out)
s,
%(o)
s)) {
if (CudaNdarray_CopyFromCudaNdarray(
%(out)
s,
%(o)
s)) {
PyErr_SetString(PyExc_RuntimeError, "Cannot copy data to output");
// Error already set
%(fail)
s
%(fail)
s
}
}
"""
%
dict
(
out
=
out
,
o
=
o
,
fail
=
sub
[
'fail'
])
"""
%
dict
(
out
=
out
,
o
=
o
,
fail
=
sub
[
'fail'
])
...
@@ -313,7 +315,8 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
...
@@ -313,7 +315,8 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
CudaNdarray_HOST_DIMS(
%(h)
s)[1] *
CudaNdarray_HOST_DIMS(
%(h)
s)[1] *
CudaNdarray_HOST_DIMS(
%(o)
s)[0]);
CudaNdarray_HOST_DIMS(
%(o)
s)[0]);
if (err != CUBLAS_STATUS_SUCCESS) {
if (err != CUBLAS_STATUS_SUCCESS) {
PyErr_SetString(PyExc_RuntimeError, "SgemvBatched failed");
PyErr_Format(PyExc_RuntimeError, "SgemvBatched failed(
%%
s)",
cublasGetErrorString(err));
%(fail)
s
%(fail)
s
}
}
}
}
...
@@ -322,7 +325,7 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
...
@@ -322,7 +325,7 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
W
=
W
,
fail
=
sub
[
'fail'
],
name
=
nodename
)
W
=
W
,
fail
=
sub
[
'fail'
],
name
=
nodename
)
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
1
0
,)
return
(
1
1
,)
def
grad
(
self
,
inputs
,
grads
):
def
grad
(
self
,
inputs
,
grads
):
o
,
W
,
h
,
inputIdx
,
outputIdx
=
inputs
o
,
W
,
h
,
inputIdx
,
outputIdx
=
inputs
...
@@ -482,7 +485,8 @@ static int SparseBlockOuter_copy(PyArrayObject *a, npy_intp *b) {
...
@@ -482,7 +485,8 @@ static int SparseBlockOuter_copy(PyArrayObject *a, npy_intp *b) {
cudaMemcpyHostToDevice);
cudaMemcpyHostToDevice);
Py_DECREF(aa);
Py_DECREF(aa);
if (err != cudaSuccess) {
if (err != cudaSuccess) {
PyErr_SetString(PyExc_RuntimeError, "Cannot copy index data to GPU");
PyErr_Format(PyExc_RuntimeError, "Cannot copy index data to GPU(
%
s)",
cudaGetErrorString(err));
return -1;
return -1;
}
}
return 0;
return 0;
...
@@ -541,11 +545,11 @@ Py_INCREF(%(out)s);
...
@@ -541,11 +545,11 @@ Py_INCREF(%(out)s);
res
=
"""
res
=
"""
if (CudaNdarray_prep_output(&
%(out)
s, 4, CudaNdarray_HOST_DIMS(
%(o)
s)))
if (CudaNdarray_prep_output(&
%(out)
s, 4, CudaNdarray_HOST_DIMS(
%(o)
s)))
{
{
PyErr_SetString(PyExc_RuntimeError, "Cannot allocate output");
// Python error already set
%(fail)
s
%(fail)
s
}
}
if (CudaNdarray_CopyFromCudaNdarray(
%(out)
s,
%(o)
s)) {
if (CudaNdarray_CopyFromCudaNdarray(
%(out)
s,
%(o)
s)) {
PyErr_SetString(PyExc_RuntimeError, "Cannot copy data to output");
//Error message already set
%(fail)
s
%(fail)
s
}
}
"""
%
dict
(
out
=
out
,
o
=
o
,
fail
=
sub
[
'fail'
])
"""
%
dict
(
out
=
out
,
o
=
o
,
fail
=
sub
[
'fail'
])
...
@@ -612,7 +616,8 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
...
@@ -612,7 +616,8 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
"block size too big. The current limit is 65535 for "
"block size too big. The current limit is 65535 for "
"iSize * oSize.");
"iSize * oSize.");
} else {
} else {
PyErr_SetString(PyExc_RuntimeError, "SgerBatched failed");
PyErr_Format(PyExc_RuntimeError, "SgerBatched failed(
%%
s)",
cublasGetErrorString(err));
}
}
%(fail)
s
%(fail)
s
}
}
...
@@ -620,7 +625,7 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
...
@@ -620,7 +625,7 @@ CudaNdarray_HOST_STRIDES(%(out)s)[0], CudaNdarray_HOST_STRIDES(%(out)s)[1],
alpha
=
alpha
,
fail
=
sub
[
'fail'
])
alpha
=
alpha
,
fail
=
sub
[
'fail'
])
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
9
,)
return
(
10
,)
sparse_block_outer_ss
=
SparseBlockOuterSS
(
False
)
sparse_block_outer_ss
=
SparseBlockOuterSS
(
False
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论