提交 a3f043b4 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron 提交者: Frederic Bastien

Fix condition for reusing output in GpuFromHost.

上级 58f260c3
...@@ -702,10 +702,10 @@ class GpuFromHost(Op): ...@@ -702,10 +702,10 @@ class GpuFromHost(Op):
if (%(name)s_tmp == NULL) if (%(name)s_tmp == NULL)
%(fail)s %(fail)s
if (%(out)s == NULL || GpuArray_IS_C_CONTIGUOUS(&%(out)s->ga) || if (%(out)s == NULL || !GpuArray_IS_C_CONTIGUOUS(&%(out)s->ga) ||
theano_size_check(%(out)s, PyArray_NDIM(%(name)s_tmp), !theano_size_check(%(out)s, PyArray_NDIM(%(name)s_tmp),
(size_t *)PyArray_DIMS(%(name)s_tmp), (size_t *)PyArray_DIMS(%(name)s_tmp),
get_typecode((PyObject *)PyArray_DESCR(%(name)s_tmp)))) { get_typecode((PyObject *)PyArray_DESCR(%(name)s_tmp)))) {
Py_XDECREF(%(out)s); Py_XDECREF(%(out)s);
%(out)s = pygpu_empty(PyArray_NDIM(%(name)s_tmp), %(out)s = pygpu_empty(PyArray_NDIM(%(name)s_tmp),
(size_t *)PyArray_DIMS(%(name)s_tmp), (size_t *)PyArray_DIMS(%(name)s_tmp),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论