提交 8c6ae0a8 authored 作者: Frederic's avatar Frederic

Add c code to gpuarray rebroadcast

上级 788e6612
...@@ -327,3 +327,16 @@ theano.compile.register_deep_copy_op_c_code(GpuArrayType, """ ...@@ -327,3 +327,16 @@ theano.compile.register_deep_copy_op_c_code(GpuArrayType, """
%(oname)s = pygpu_copy(%(iname)s, GA_ANY_ORDER); %(oname)s = pygpu_copy(%(iname)s, GA_ANY_ORDER);
if (!%(oname)s) { %(fail)s } if (!%(oname)s) { %(fail)s }
""", version=(5,)) """, version=(5,))
theano.compile.register_rebroadcast_c_code(
GpuArrayType,
"""
if(PyGpuArray_DIMS(%(iname)s)[%(axis)s] != 1){
PyErr_Format(PyExc_ValueError,
"Dimension %(axis)s in Rebroadcast's input was"
" supposed to be 1 (got %%d instead)",
PyGpuArray_DIMS(%(iname)s)[%(axis)s]);
%(fail)s
}
""",
version=1)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论