提交 13c43183 authored 作者: lamblin's avatar lamblin

Merge pull request #1225 from nouiz/fix_gpu_strides_crash

make filter for CudaNdarray check for stride == 0 for dim == 1.
...@@ -168,9 +168,9 @@ Interface changes: ...@@ -168,9 +168,9 @@ Interface changes:
* We do not support anymore unaligned ndarray in Python code. (Frederic B.) * We do not support anymore unaligned ndarray in Python code. (Frederic B.)
We did not support it in C code and supporting it in Python code made We did not support it in C code and supporting it in Python code made
the detection harder. the detection harder.
* Now we only officially support scipy 0.7.2 and numpy 1.5.0 (Frederic B.) * Now we only officially support SciPy 0.7.2 and NumPy 1.5.0 (Frederic B.)
We weren't and aren't testing with older versions. We weren't and aren't testing with older versions.
* The theano.sparse.SparseType is available even when scipy is not (Frederic B.) * The theano.sparse.SparseType is available even when SciPy is not (Frederic B.)
* Fixed issue where members of consider_constant grad parameter * Fixed issue where members of consider_constant grad parameter
were treated differently from Constant variables. (Ian G.) were treated differently from Constant variables. (Ian G.)
* Removed the parameter g_cost from theano.grad(). (Ian G.) * Removed the parameter g_cost from theano.grad(). (Ian G.)
......
...@@ -2956,6 +2956,12 @@ filter(PyObject* __unsed_self, PyObject *args) // args = (data, broadcastable, s ...@@ -2956,6 +2956,12 @@ filter(PyObject* __unsed_self, PyObject *args) // args = (data, broadcastable, s
Py_DECREF(py_data); Py_DECREF(py_data);
Py_DECREF(broadcastable); Py_DECREF(broadcastable);
return NULL; return NULL;
}else if (CudaNdarray_HOST_DIMS(cnda)[i] == 1 && CudaNdarray_HOST_STRIDES(cnda)[i] != 0){
PyErr_Format(PyExc_TypeError, "Non-zeros strides(%d) on dimension %d of size 1",
CudaNdarray_HOST_STRIDES(cnda)[i], i);
Py_DECREF(py_data);
Py_DECREF(broadcastable);
return NULL;
} }
} }
Py_DECREF(broadcastable); Py_DECREF(broadcastable);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论