提交 99cca869 authored 作者: Frederic's avatar Frederic

Fix indent (not wrong code) and better comment following code review.

上级 ba38ab4b
...@@ -1140,14 +1140,14 @@ class Elemwise(Op): ...@@ -1140,14 +1140,14 @@ class Elemwise(Op):
if not all(var.broadcastable): if not all(var.broadcastable):
contig += """ contig += """
dtype_%(x)s * %(x)s_ptr = (dtype_%(x)s*) PyArray_DATA(%(x)s); dtype_%(x)s * %(x)s_ptr = (dtype_%(x)s*) PyArray_DATA(%(x)s);
""" % locals() """ % locals()
index += """ index += """
dtype_%(x)s& %(x)s_i = %(x)s_ptr[i]; dtype_%(x)s& %(x)s_i = %(x)s_ptr[i];
""" % locals() """ % locals()
else: else:
contig += """ contig += """
dtype_%(x)s& %(x)s_i = ((dtype_%(x)s*) PyArray_DATA(%(x)s))[0]; dtype_%(x)s& %(x)s_i = ((dtype_%(x)s*) PyArray_DATA(%(x)s))[0];
""" % locals() """ % locals()
contig += """ contig += """
for(int i=0; i<n; i++){ for(int i=0; i<n; i++){
......
...@@ -116,8 +116,9 @@ def make_checks(loop_orders, dtypes, sub): ...@@ -116,8 +116,9 @@ def make_checks(loop_orders, dtypes, sub):
def make_alloc(loop_orders, dtype, sub, fortran='0'): def make_alloc(loop_orders, dtype, sub, fortran='0'):
"""Generate C code to allocate outputs. """Generate C code to allocate outputs.
:param fortran: if non-zero, will create a ndarray in fortran :param fortran: a string included in the generated code. If it
order. evaludate to non-zero, an ndarray in fortran order will be
created, otherwise it will be c order.
""" """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论