Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
055d1774
提交
055d1774
authored
3月 27, 2015
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2686 from lamblin/cleanup
Small fixes after the release
上级
1040e20b
176cec01
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
43 行增加
和
51 行删除
+43
-51
how_to_release.txt
doc/internal/how_to_release.txt
+0
-12
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+5
-5
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+4
-15
cuda_ndarray.cuh
theano/sandbox/cuda/cuda_ndarray.cuh
+1
-4
conv.py
theano/tensor/nnet/conv.py
+33
-15
没有找到文件。
doc/internal/how_to_release.txt
浏览文件 @
055d1774
...
@@ -82,18 +82,6 @@ UnicodeDecodeError if there are non-ASCII characters in NEWS.txt. You
...
@@ -82,18 +82,6 @@ UnicodeDecodeError if there are non-ASCII characters in NEWS.txt. You
would need to change NEWS.txt so it contains only ASCII characters (the
would need to change NEWS.txt so it contains only ASCII characters (the
problem usually comes from diacritics in people's names).
problem usually comes from diacritics in people's names).
On freecode (formaly freshmeat)
-------------------------------
Theano project page at freecode is `here <http://freecode.com/projects/theano>`__.
The package itself is not uploaded to freecode, the only thing to update is
the description and tags.
ou can request the rights to add a release from an admin (for instance Fred),
pointing them to `the "roles" page
<http://freecode.net/projects/theano/roles>`__. Then, create a new release from
`the "releases" page <http://freecode.net/projects/theano/releases>`__.
On mloss.org
On mloss.org
------------
------------
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
055d1774
...
@@ -1176,7 +1176,7 @@ class GpuCAReduce(GpuOp):
...
@@ -1176,7 +1176,7 @@ class GpuCAReduce(GpuOp):
int verbose = 0;
int verbose = 0;
dim3 n_threads(
dim3 n_threads(
std::min(CudaNdarray_SIZE(
%(x)
s),
std::min(CudaNdarray_SIZE(
%(x)
s),
NUM_VECTOR_OP_THREADS_PER_BLOCK));
(size_t)
NUM_VECTOR_OP_THREADS_PER_BLOCK));
dim3 n_blocks(1);
dim3 n_blocks(1);
if (verbose) printf("running kernel_reduce_ccontig_
%(name)
s"
if (verbose) printf("running kernel_reduce_ccontig_
%(name)
s"
" n_threads.x=
%%
d, size=
%%
d, ndim=
%%
d
\\
n",
" n_threads.x=
%%
d, size=
%%
d, ndim=
%%
d
\\
n",
...
@@ -1739,7 +1739,7 @@ class GpuCAReduce(GpuOp):
...
@@ -1739,7 +1739,7 @@ class GpuCAReduce(GpuOp):
"""
%
locals
()
"""
%
locals
()
def
c_code_cache_version_apply
(
self
,
node
):
def
c_code_cache_version_apply
(
self
,
node
):
version
=
[
1
1
]
# the version corresponding to the c code in this Op
version
=
[
1
2
]
# the version corresponding to the c code in this Op
# now we insert versions for the ops on which we depend...
# now we insert versions for the ops on which we depend...
scalar_node
=
Apply
(
self
.
scalar_op
,
scalar_node
=
Apply
(
self
.
scalar_op
,
...
@@ -3380,13 +3380,13 @@ class GpuAlloc(GpuAllocEmpty):
...
@@ -3380,13 +3380,13 @@ class GpuAlloc(GpuAllocEmpty):
if (
%(memset_0)
s && CudaNdarray_is_c_contiguous(
%(out)
s))
if (
%(memset_0)
s && CudaNdarray_is_c_contiguous(
%(out)
s))
{
{
cudaError_t err = cudaMemset(
%(out)
s->devdata, 0,
cudaError_t err = cudaMemset(
%(out)
s->devdata, 0,
CudaNdarray_SIZE
t
(
%(out)
s) * 4);
CudaNdarray_SIZE(
%(out)
s) * 4);
if (cudaSuccess != err)
if (cudaSuccess != err)
{
{
PyErr_Format(PyExc_MemoryError,
PyErr_Format(PyExc_MemoryError,
"GpuAlloc: Error memsetting
%%
ld"
"GpuAlloc: Error memsetting
%%
ld"
" bytes of device memory.
%%
s",
" bytes of device memory.
%%
s",
(long)(CudaNdarray_SIZE
t
(
%(out)
s) * 4),
(long)(CudaNdarray_SIZE(
%(out)
s) * 4),
cudaGetErrorString(err));
cudaGetErrorString(err));
Py_XDECREF(
%(out)
s);
Py_XDECREF(
%(out)
s);
%(out)
s = NULL;
%(out)
s = NULL;
...
@@ -3407,7 +3407,7 @@ class GpuAlloc(GpuAllocEmpty):
...
@@ -3407,7 +3407,7 @@ class GpuAlloc(GpuAllocEmpty):
return
[
node
.
inputs
[
1
:]]
return
[
node
.
inputs
[
1
:]]
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
9
,)
return
(
10
,)
def
do_constant_folding
(
self
,
node
):
def
do_constant_folding
(
self
,
node
):
for
client
in
node
.
outputs
[
0
]
.
clients
:
for
client
in
node
.
outputs
[
0
]
.
clients
:
...
...
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
055d1774
...
@@ -848,7 +848,7 @@ PyObject * CudaNdarray_Reshape(CudaNdarray * self, PyObject * shape)
...
@@ -848,7 +848,7 @@ PyObject * CudaNdarray_Reshape(CudaNdarray * self, PyObject * shape)
// check shape tuple
// check shape tuple
unsigned
int
rval_nd
;
unsigned
int
rval_nd
;
unsigned
int
*
rval_dims
;
unsigned
int
*
rval_dims
;
unsigned
in
t
rval_size
=
1
;
size_
t
rval_size
=
1
;
if
(
PyTuple_Check
(
shape
)){
if
(
PyTuple_Check
(
shape
)){
// copy shape to integer array
// copy shape to integer array
...
@@ -884,7 +884,7 @@ PyObject * CudaNdarray_Reshape(CudaNdarray * self, PyObject * shape)
...
@@ -884,7 +884,7 @@ PyObject * CudaNdarray_Reshape(CudaNdarray * self, PyObject * shape)
// calculate new size, assert same as old size
// calculate new size, assert same as old size
if
(
rval_size
!=
CudaNdarray_SIZE
(
self
))
if
(
rval_size
!=
CudaNdarray_SIZE
(
self
))
{
{
PyErr_Format
(
PyExc_ValueError
,
"size must remain unchanged, changed from %
i to %i
"
,
CudaNdarray_SIZE
(
self
),
rval_size
);
PyErr_Format
(
PyExc_ValueError
,
"size must remain unchanged, changed from %
lld to %lld
"
,
CudaNdarray_SIZE
(
self
),
rval_size
);
free
(
rval_dims
);
free
(
rval_dims
);
return
NULL
;
return
NULL
;
}
}
...
@@ -1309,7 +1309,7 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){
...
@@ -1309,7 +1309,7 @@ CudaNdarray_TakeFrom(CudaNdarray * self, PyObject *args){
if
(
cpu_err_var
!=
0
)
{
if
(
cpu_err_var
!=
0
)
{
PyErr_Format
(
PyErr_Format
(
PyExc_IndexError
,
PyExc_IndexError
,
"CudaNdarray_TakeFrom: One of the index value is out of bound.
\n
"
,
"CudaNdarray_TakeFrom: One of the index value is out of bound.
Error code: %i.
\n
"
,
cpu_err_var
);
cpu_err_var
);
// Must reset it to 0 to don't reset it before each use.
// Must reset it to 0 to don't reset it before each use.
err
=
cudaMemset
((
void
*
)
err_var
,
0
,
sizeof
(
int
));
err
=
cudaMemset
((
void
*
)
err_var
,
0
,
sizeof
(
int
));
...
@@ -5106,7 +5106,7 @@ CudaNdarray_DEV_DATA(const CudaNdarray * self)
...
@@ -5106,7 +5106,7 @@ CudaNdarray_DEV_DATA(const CudaNdarray * self)
/**
/**
* Return the number of elements in the ndarray (product of the dimensions)
* Return the number of elements in the ndarray (product of the dimensions)
*/
*/
in
t
size_
t
CudaNdarray_SIZE
(
const
CudaNdarray
*
self
)
CudaNdarray_SIZE
(
const
CudaNdarray
*
self
)
{
{
if
(
self
->
nd
==
-
1
)
return
0
;
if
(
self
->
nd
==
-
1
)
return
0
;
...
@@ -5117,17 +5117,6 @@ CudaNdarray_SIZE(const CudaNdarray *self)
...
@@ -5117,17 +5117,6 @@ CudaNdarray_SIZE(const CudaNdarray *self)
}
}
return
size
;
return
size
;
}
}
size_t
CudaNdarray_SIZEt
(
const
CudaNdarray
*
self
)
{
if
(
self
->
nd
==
-
1
)
return
0
;
size_t
size
=
1
;
for
(
int
i
=
0
;
i
<
self
->
nd
;
++
i
)
{
size
*=
CudaNdarray_HOST_DIMS
(
self
)[
i
];
}
return
size
;
}
PyObject
*
PyObject
*
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
)
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
)
...
...
theano/sandbox/cuda/cuda_ndarray.cuh
浏览文件 @
055d1774
...
@@ -285,10 +285,7 @@ DllExport float *CudaNdarray_DEV_DATA(const CudaNdarray * self);
...
@@ -285,10 +285,7 @@ DllExport float *CudaNdarray_DEV_DATA(const CudaNdarray * self);
/**
/**
* Return the number of elements in the ndarray (product of the dimensions)
* Return the number of elements in the ndarray (product of the dimensions)
*/
*/
DllExport
int
CudaNdarray_SIZE
(
const
CudaNdarray
*
self
);
DllExport
size_t
CudaNdarray_SIZE
(
const
CudaNdarray
*
self
);
// Useful as many cuda function use size_t as input. This make sure we use the
// most precission and not int.
DllExport
size_t
CudaNdarray_SIZEt
(
const
CudaNdarray
*
self
);
static
PyObject
*
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
);
static
PyObject
*
CudaNdarray_SIZE_Object
(
const
CudaNdarray
*
self
,
void
*
closure
);
...
...
theano/tensor/nnet/conv.py
浏览文件 @
055d1774
...
@@ -674,22 +674,30 @@ class ConvOp(OpenMPOp):
...
@@ -674,22 +674,30 @@ class ConvOp(OpenMPOp):
if
any
(
x
is
None
for
x
in
imshp
):
if
any
(
x
is
None
for
x
in
imshp
):
imshp
=
tuple
(
img2d
.
shape
[
1
:])
imshp
=
tuple
(
img2d
.
shape
[
1
:])
if
imshp
!=
img2d
.
shape
[
1
:]:
if
imshp
!=
img2d
.
shape
[
1
:]:
raise
ValueError
(
"bad shape"
,
imshp
,
img2d
.
shape
[
1
:])
raise
ValueError
(
"The image shape provided at build time "
"is different from the one passed at run time"
,
imshp
,
img2d
.
shape
[
1
:])
kshp
=
self
.
kshp
kshp
=
self
.
kshp
if
any
(
x
is
None
for
x
in
kshp
):
if
any
(
x
is
None
for
x
in
kshp
):
kshp
=
tuple
(
filtersflipped
.
shape
[
2
:])
kshp
=
tuple
(
filtersflipped
.
shape
[
2
:])
if
kshp
!=
filtersflipped
.
shape
[
2
:]:
if
kshp
!=
filtersflipped
.
shape
[
2
:]:
raise
ValueError
(
"bad shape"
,
kshp
,
filtersflipped
.
shape
[
2
:])
raise
ValueError
(
"The filter shape provided at build time "
"is different from the one passed at run time"
,
kshp
,
filtersflipped
.
shape
[
2
:])
bsize
=
self
.
bsize
bsize
=
self
.
bsize
if
bsize
is
None
:
if
bsize
is
None
:
bsize
=
img2d
.
shape
[
0
]
bsize
=
img2d
.
shape
[
0
]
elif
bsize
!=
img2d
.
shape
[
0
]:
elif
bsize
!=
img2d
.
shape
[
0
]:
raise
ValueError
(
"bad shape"
,
bsize
,
img2d
.
shape
[
0
])
raise
ValueError
(
"The batch size provided at build time "
"is different from the one passed at run time"
,
bsize
,
img2d
.
shape
[
0
])
nkern
=
self
.
nkern
nkern
=
self
.
nkern
if
nkern
is
None
:
if
nkern
is
None
:
nkern
=
filtersflipped
.
shape
[
0
]
nkern
=
filtersflipped
.
shape
[
0
]
elif
nkern
!=
filtersflipped
.
shape
[
0
]:
elif
nkern
!=
filtersflipped
.
shape
[
0
]:
raise
ValueError
(
"bad shape"
,
nkern
,
filtersflipped
.
shape
[
0
])
raise
ValueError
(
"The number of filters provided at build time "
"is different from the one passed at run time"
,
nkern
,
filtersflipped
.
shape
[
0
])
imshp_logical
=
self
.
imshp_logical
imshp_logical
=
self
.
imshp_logical
if
imshp_logical
[
0
]
is
None
:
if
imshp_logical
[
0
]
is
None
:
...
@@ -984,7 +992,7 @@ class ConvOp(OpenMPOp):
...
@@ -984,7 +992,7 @@ class ConvOp(OpenMPOp):
return
[
'<numpy/noprefix.h>'
,
'<iostream>'
,
'<sstream>'
]
return
[
'<numpy/noprefix.h>'
,
'<iostream>'
,
'<sstream>'
]
def
c_code_cache_version
(
self
):
def
c_code_cache_version
(
self
):
return
(
1
4
,
self
.
openmp
,
blas
.
blas_header_version
())
return
(
1
5
,
self
.
openmp
,
blas
.
blas_header_version
())
def
c_support_code
(
self
):
def
c_support_code
(
self
):
return
"""
return
"""
...
@@ -1088,7 +1096,8 @@ using namespace std;
...
@@ -1088,7 +1096,8 @@ using namespace std;
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the number of rows in the filter "
"(
%%
ld) isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1100,7 +1109,8 @@ if(%(value)s != %(expected)s){
...
@@ -1100,7 +1109,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the number of columns in the filter "
"(
%%
ld) isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1112,7 +1122,8 @@ if(%(value)s != %(expected)s){
...
@@ -1112,7 +1122,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the number of rows in the output "
"(
%%
ld) isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1124,7 +1135,8 @@ if(%(value)s != %(expected)s){
...
@@ -1124,7 +1135,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the number of columns in the output "
"(
%%
ld) isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1136,7 +1148,8 @@ if(%(value)s != %(expected)s){
...
@@ -1136,7 +1148,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the image stack size (
%%
ld) "
"isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1146,7 +1159,8 @@ if(%(value)s != %(expected)s){
...
@@ -1146,7 +1159,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the kernel stack size (
%%
ld) "
"isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1158,7 +1172,8 @@ if(%(value)s != %(expected)s){
...
@@ -1158,7 +1172,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the number of rows in the image "
"(
%%
ld) isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1170,7 +1185,8 @@ if(%(value)s != %(expected)s){
...
@@ -1170,7 +1185,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the number of columns in the image "
"(
%%
ld) isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1182,7 +1198,8 @@ if(%(value)s != %(expected)s){
...
@@ -1182,7 +1198,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the batch size (
%%
ld) "
"isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
@@ -1194,7 +1211,8 @@ if(%(value)s != %(expected)s){
...
@@ -1194,7 +1211,8 @@ if(%(value)s != %(expected)s){
d
[
"assert_size"
]
+=
"""
d
[
"assert_size"
]
+=
"""
if(
%(value)
s !=
%(expected)
s){
if(
%(value)
s !=
%(expected)
s){
PyErr_Format(PyExc_ValueError,
PyErr_Format(PyExc_ValueError,
"the hard coded shape (
%%
ld) isn't the run time shape (
%%
ld).",
"The hardcoded shape for the number of kernels in the filter "
"(
%%
ld) isn't the run time shape (
%%
ld).",
(long)
%(value)
s, (long)
%(expected)
s);
(long)
%(value)
s, (long)
%(expected)
s);
%(fail)
s;
%(fail)
s;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论