提交 ca5fbc8c authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fixed seg fault where I tried to increment the DESCR of a cuda array

上级 1737ddd5
...@@ -4595,7 +4595,6 @@ class IncSubtensor(Op): ...@@ -4595,7 +4595,6 @@ class IncSubtensor(Op):
build_view = """ build_view = """
//TODO: give this Op a second output so that this view can be cached //TODO: give this Op a second output so that this view can be cached
//TODO: alternatively, fix the memory leak on failure //TODO: alternatively, fix the memory leak on failure
Py_INCREF(PyArray_DESCR(%(z)s));
%(alloc_view_of_z)s; %(alloc_view_of_z)s;
if (!xview) if (!xview)
{ {
...@@ -4696,7 +4695,8 @@ class IncSubtensor(Op): ...@@ -4696,7 +4695,8 @@ class IncSubtensor(Op):
right indexing; we'll do that manually later. right indexing; we'll do that manually later.
""" """
return """PyArrayObject * xview = return """Py_INCREF(PyArray_DESCR(%(z)s));
PyArrayObject * xview =
(PyArrayObject*)PyArray_NewFromDescr( (PyArrayObject*)PyArray_NewFromDescr(
&PyArray_Type, &PyArray_Type,
PyArray_DESCR(%(x)s), PyArray_DESCR(%(x)s),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论