提交 2cfc4c11 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix DeepCopyOp C code.

上级 e1c763e1
...@@ -280,7 +280,7 @@ theano.compile.register_view_op_c_code(GpuArrayType, """ ...@@ -280,7 +280,7 @@ theano.compile.register_view_op_c_code(GpuArrayType, """
theano.compile.register_deep_copy_op_c_code(GpuArrayType, """ theano.compile.register_deep_copy_op_c_code(GpuArrayType, """
Py_XDECREF(%(oname)s); Py_XDECREF(%(oname)s);
%(oname)s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context()); %(oname)s = new_GpuArray((PyObject *)&GpuArrayType, GpuArray_default_context(), Py_None);
if (!%(oname)s) { %(fail)s } if (!%(oname)s) { %(fail)s }
int %(iname)s_err; int %(iname)s_err;
%(iname)s_err = GpuArray_copy(&%(oname)s->ga, &%(iname)s->ga, GA_ANY_ORDER); %(iname)s_err = GpuArray_copy(&%(oname)s->ga, &%(iname)s->ga, GA_ANY_ORDER);
...@@ -288,4 +288,4 @@ theano.compile.register_deep_copy_op_c_code(GpuArrayType, """ ...@@ -288,4 +288,4 @@ theano.compile.register_deep_copy_op_c_code(GpuArrayType, """
PyErr_SetString(PyExc_RuntimeError, "Error during copy"); PyErr_SetString(PyExc_RuntimeError, "Error during copy");
%(fail)s %(fail)s
} }
""", version=(2,)) """, version=(3,))
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论